Hi !

>From your question, I guess that you need a multiple of checkboxes, so
you need <html:multibox> instead of <html:checkbox>

for your reference:
http://struts.apache.org/userGuide/struts-html.html#multibox

and a wonderful example:
http://j2ee.lagnada.com/struts/multibox-example1.htm

you would need an action form, which contains 2 arrays (normally they
would be String array)
eg. an Action form called FrmMultiBox with properties :
String [] options; String[] selected;

options[] is holding the "options" of the checkboxes that user going to select
selected[] would be populated by Struts after form submission, value
of selected[] is the value of "checked" checkboxes.

so if options = new String {"1", "2", "3"} (you can made them final or
load the values from another Action dynamically from somewhere else)

in your JSP:

<struts-logic:iterate id="_bean" name="FrmMultiBox" property="options">
           <struts-html:multibox property="selected">
                     <struts-bean:write name="_bean"/>
           </struts-html:multibox>
           <struts-bean:write name="_bean"/>
</struts-logic:iterate>

if user check "1" and "3" then selected[] would contains "1" and "3"
(Thanks Struts !)

and don't forget the formal getter and setter method of your Action form

Hope this help

Regards

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to