I am realtively new to the Spring MVC framework and have recently started exploring it. I have so far achieved implementing a single form with 2 fields, validating the user inputs in the command object (bound to the form) and ahndling of the request in a Controller extended from SimpleFormController.
I also understood that the method formBackingObject() can be overrided and the command object can be initialized so that during the 'request' phase, the form view can display the default values in the respective fields.
So far so good.
Now I am thinking of implementing a new page with a 'not so simple' form implementation. I need to have two drop down fields on the form. The values in the second drop down should depend on (and get refreshed with) the value selected in the first drop down. However, I am not sure as to how this can be achived using the Spring MVC framework.
Would appreciate if somebody can provide some suggestions, code snippets etc.
I'm in the same boat, Just finished some simple stuff and now planning to do a little bit advance in sping. Just wanted to know whether: you need to populate the second drop down value based on the fist dropdown value at form load time? or You want to select the 1st dropdown and based on that you want to select the other one.(In this case we can use AJAX)
Joined: Jul 08, 2007
Good to know that there is somebody with me in the _same boat_ . What I need to do is to populate a specific set of values in the second drop down based on the the value selected in the first one. to give you an example, the first drop down may list 'product categories' and the second one lists the products in each catedory. So when you select a particular 'Product Category' in the first drop down, the second drop down should refresh and get all the products for that particular category.