Problem:
I have a Collection of value objects(say User(userId, name, dateOfBirth..). One Action sets the collection in session and forwards to a JSP that displays a list of Users using <logic:iterate> over this collection.
One each row of User information, one checkbox is provided to select one. Now if I select multiple checkboxes and submit the form(in JSP), I need the ActionForm to have a Collection that has User value objects corresponding to the selected user information.
How can we do this in struts?
Pepper
-
Need a struts based solution for this (2 messages)
- Posted by: sgt pepper
- Posted on: November 21 2003 16:24 EST
Threaded Messages (2)
- Need a struts based solution for this by stephen smithstone on November 21 2003 17:28 EST
- Thanks by sgt pepper on November 24 2003 14:45 EST
-
Need a struts based solution for this[ Go to top ]
- Posted by: stephen smithstone
- Posted on: November 21 2003 17:28 EST
- in response to sgt pepper
Problem:
> I have a Collection of value objects(say User(userId, name, dateOfBirth..). One Action sets the collection in session and forwards to a JSP that displays a list of Users using <logic:iterate> over this collection.
> One each row of User information, one checkbox is provided to select one. Now if I select multiple checkboxes and submit the form(in JSP), I need the ActionForm to have a Collection that has User value objects corresponding to the selected user information.
>
> How can we do this in struts?
> Pepper
in your jsp page have use an html:multibox with the property set the form property which will be a String[] and for the html:mutltibox value use the value that you in the array
http://husted.com/struts/tips/
and for the multibox example
http://husted.com/struts/tips/007.html -
Thanks[ Go to top ]
- Posted by: sgt pepper
- Posted on: November 24 2003 14:45 EST
- in response to stephen smithstone
thanks buddy.
That link is really useful.