Jan 31st, 2011, 04:24 PM
Spring 3.0 Dynamic MVC question
I am trying to find an example or figure out what the correct way to implement the following dynamic form should work.
I have a simple form where I have a select box with a list of states. Lets say for Arizona I want to display field1, field 2, field3. If the user selects California I will show fieldX, fieldY, fieldZ. The correct fields to display comes from the database. Can someone please help me decide how to set up my model , view, and controller?
Any suggestions/examples would be appreciated.
Feb 1st, 2011, 02:57 PM
First you are going to have to pick between one of two options based on what happens when a user picks an item.
If (2), you will need a controller to handle the ajax callback. The view for this can be a html snippet containing the new form elements.
Feb 1st, 2011, 04:03 PM
Thanks for the reply.
I dont mind doing a form submit when the state is changed.
I was mainly wondering if there was a Spring 3.x way to create a dynamic model then bind it to a dynamic form.
Tags for this Thread