List controls with dependecies
This function will be called in case of changes in the master list and we will pass two parameters: selected index in the master list (parameter's name is index) and DHTML for the slave control (parameter's name is list).
In our server-side element (newList.jsp) we will calculate a list of options (cities) for our
from our Coldtags suite. This taglib (List filling) outputs
At the end of the deal we will have the following:
Here all the calculation was done right in JSP. But of course, you can follow to the MVC approach too.
Sure, you can define the above mentioned function through some servlet (controller, Struts action):
That is all. The only question is it Ajax or not? See, there is no XML in our code :-)
© Coldbeans Comments?
See also Other tips from Coldbeans.