J
Jim Smith
I have a fairly simple problem which I am having trouble solving using
struts.
The problem.
I have a list of items (a List) which I want to display in a JSP, allow
the user to select some of them and submit the page to produce a report
based on the items selected.
If I was doing this in straight JSP/HTML I would list the items with a
checkbox whose value is the id of the item. This would make an array of
ids available to the back end.
I can't seem to do this with struts. Checkboxes can only have boolean
values, parallel arrays of hidden fields containing the id and a check
boxes don't work because the boolean array only contains those fields
which are checked and which puts it out of synch with the id array.
The only thing I can think of is using javascript to set hidden field
values when the check boxes are clicked, but there ought to be a cleaner
way.
Any suggestions.
struts.
The problem.
I have a list of items (a List) which I want to display in a JSP, allow
the user to select some of them and submit the page to produce a report
based on the items selected.
If I was doing this in straight JSP/HTML I would list the items with a
checkbox whose value is the id of the item. This would make an array of
ids available to the back end.
I can't seem to do this with struts. Checkboxes can only have boolean
values, parallel arrays of hidden fields containing the id and a check
boxes don't work because the boolean array only contains those fields
which are checked and which puts it out of synch with the id array.
The only thing I can think of is using javascript to set hidden field
values when the check boxes are clicked, but there ought to be a cleaner
way.
Any suggestions.