How to generate dynamic list of checkboxlist selection
posted 6 years ago
In Action class [ActionSupport extended]
1. equipmentSpeed is object (with get & set method in Action Class), which has getDiscreteConstrains() method which returns List<DiscreteConstrain> object.
DiscreteConstrain has getPossibleValues() method which returns List<String>
2. There is one more object limitPossibleConstrains of class DiscreteConstrain in Action.
I want to iterate over equipmentSpeed.discreteConstrains and get possibleValues which should be selected [checkboxes] and parent set(items of checkbox) should be limitPossibleConstrains[i].possibleValues value
Please identify why following code is not working... [OR Suggest alternative solution..]
Before software can be reusable, it first has to be usable. - Ralph Johnson
When you iterate over a list, items in the list are placed on top of the value stack. Your iterator tag is useless. You are only using it like a for loop to get index locations. You should use the element i.e. DiscreteContrain elements placed on top of the value stack by the iterator. This code should work but I've not tried it (I don't understand your problem correctly so my code might not be according to what you want)