Sometimes it is necessary to let the users of a Web application make several choices of multiple options, each choice depending on the previous.
Choices of multiple options can be implemented in Web applications with form select inputs. However, if you want to make a second choice control that depends on what was chosen in the first, you need to update the second select input with a different set of options depending on the first option.
The solution to implement this kind of dynamic control of options provided by this class is to generate the necessary Javascript that makes the second select input load a new set of options when the first select input change its currently selected option.
This type of user interface manipulation could be implemented without the need to resort to Javascript, by using additional buttons that the user would have to use every time he changes the first select input, so the server could load an update form with a different set of options in the second select input. However this approach would make the forms less usable than when using the solution provided by this class.
This class is meant to create dynamically linked list with form select inputs that work as controls for choosing master and detail options.
The class takes the definitions of lists options for primary select input and the corresponding options that should be made available in the secondary input is selected.
The class generates the HTML for defining both the form input as well the necessary Javascript code to dynamically switch the set options of the secondary input depending on the option of the primary input that is selected.