I'm having a difficult time with checkboxes and iterating through a few nested collections.
-My form page contains a Hashtable of OrderMaster objects.
-An OrderMaster contains an ArrayList of Order objects.
-The Order objects themselves contain an ArrayList of details.
I am displaying that structure on my
JSP page as an unordered list, and I would like to have a checkbox on at least the detail level (lowest level).
My unordered list ends up looking like this:
(the [] denotes a check box)
Order (Order Master 1)
----[] Release 1(Order)
--------[] Detail 1
--------[] Detail 2
----[] Release 2 (Order)
--------[] Detail 1
I have the details of the structure displaying correctly. The data in each object is being printed to the screen. My problem is the values of the check boxes are not being submitted with the form.
Starting from the lowest level going up, here are my data objects and form.
The OrderDetail is a plain
java object:
Now for my Order object, which contains a "selected" flag, and a list of OrderDetails. Another plain java object:
One more plain java object, which contains a list of Orders
Now for my ActionForm. The form object contains a table of OrderMaster objects
Here is the JSP code for my list. This seems to display the data properly for each nested iterate, however, clicking on the check box and submitting doesn't change any of the bean's "selected" value.
I can't figure out why that doesn't work: