Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java Forms
Hi! Currently I am trying to create a project where I list, edit, delete and create personal details for persons. I am at a stage where I need to create a address page.
 
I wanted to create a drop down menu similar to a style like Html.DropDownListFor object in which I had 2 options. One option would generate below a form with certain fields, which can be edited, and second option would generate also different field, which can be edited.(The process should be happening in the same page)
 
Can anyone tell me where to start researching, because I can't find the right keywords for this in google?
Posted 9-May-13 21:26pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

What you have done so far and where are you stuck ?
 
over all
 
1.Create an MVC 4.0 project and point to a database (does automatically up to some extend)
2.Create the classes you need (Code first method)
3.Generate the pages (can do automatically)
 
If you need a menu option then have to consider something like bootsrap or similar - http://twitter.github.io/bootstrap/[^]
 

Let me know, if this any help or you need more detailed (if so, which manner and what you have done so far?)
  Permalink  
Comments
Māris Jurgenbergs at 10-May-13 4:07am
   
This is the view page I commented, where I wanted the drop down list style object and what it would filter.
Answers to your questions:
1.Have done that.
2.Atm I have the classes to create the view i posted below. I think I need to create this filter menu in order to create other classes which edit the view below I posted.
3.Not sure what did you mean by generate pages. Is compiling what you ment?
 
I just need a field which has 2 drop down options. I was told that this can be done with java, but I am not experienced with java.
<pre>@model PersonRegisterProject.ViewModels.AddressViewModel
@{
ViewBag.Title = "AddressIndex";
}
<style type="text/css">
th
{
color: #8C1717;
background-color: #b0b0b0;
border: 1px #000;
}
</style>
@Html.ValidationSummary()
@*@Html.Partial("Navigation", new PersonRegisterProject.ViewModels.NavigationViewModel() { PersonId = @Model.PersonId, Identifier = @Model.Identifier })*@

AddressIndex

@using (Html.BeginForm())
{
<fieldset>
<div>
@Html.HiddenFor(address => address.PersonId)
</div>
@*DropDownListFor the option to be able to choose few of the <div> fields. Depends on the option you choose *@
@*option 1 start*@
<div>
@Html.LabelFor(address => address.RegionId)
@Html.DropDownListFor(address => address.RegionId, Model.Items)
@Html.ValidationMessageFor(address => address.RegionId)
</div>
<div>
@Html.LabelFor(address => address.ParishId)
@Html.DropDownListFor(address => address.ParishId, Model.Items2)
@Html.ValidationMessageFor(address => address.ParishId)
</div>
<div>
@Html.LabelFor(address => address.CityId)
@Html.DropDownListFor(address => address.CityId, Model.Items3)
@Html.ValidationMessageFor(address => address.CityId)
</div>
<div>
@Html.LabelFor(address => address.SuburbId)
@Html.DropDownListFor(address => address.SuburbId, Model.Items4)
@Html.ValidationMessageFor(address => address.SuburbId)
</div>
<div>
@Html.LabelFor(address => address.Street)
@Html.TextBoxFor(address => address.Street)
@Html.ValidationMessageFor(address => address.Street)
</div>
<div>
@Html.LabelFor(address => address.HouseNr)
@Html.TextBoxFor(address => address.HouseNr)
@Html.ValidationMessageFor(address => address.HouseNr)
</div>
<div>
@Html.LabelFor(address => address.HouseDetails)
@Html.TextBoxFor(address => address.HouseDetails)
@Html.ValidationMessageFor(address => address.HouseDetails)
</div>
<div>
@Html.LabelFor(address => address.PostalCodeId)
@Html.DropDownListFor(address => address.PostalCodeId, Model.Items5)
@Html.ValidationMessageFor(address => address.PostalCodeId)
</div>
<div>
@Html.LabelFor(address => address.RecordDate)
@Html.TextBoxFor(address => address.RecordDate)
@Html.ValidationMessageFor(address => address.RecordDate)
</div>
@*option 1 end*@
@*option 2 start*@
<div>
@Html.LabelFor(address => address.CountryId)
@Html.DropDownListFor(address => address.CountryId, Model.Items6)
@Html.ValidationMessageFor(address => address.CountryId)
</div>
<div>
@Html.LabelFor(address => address.Address)
@Html.TextBoxFor(address => address.Address)
@Html.ValidationMessageFor(address => address.Address)
</div>
@*option 2 end*@
<p>
<inp

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 406
1 /\jmot 180
2 Suraj Sahoo | Coding Passion 170
3 BillWoodruff 159
4 Afzaal Ahmad Zeeshan 154
0 OriginalGriff 8,344
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,634
3 Maciej Los 5,024
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 10 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100