You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mi...@wirecard.com on 2003/06/16 15:53:26 UTC

Struts Multibox example

Hi over there,

I'm new into the Struts area and I hope that somebody can give me a piece of help with implementing Multibox tag into my scenario.

Here is my problem: 
I have into the session a simple ArrayList containing ValueObjects. Each ValueObject is a JavaBean, one of the properties being "id".
I would like to associate into my JSP a line for each ValueObject into the ArrayList and the values of the id properties to be the value of the generated checkboxes
My plan is to read/store into my ActionForm the checked lines into a variable of type String[].

What I've done is to loop through the ArrayList using logic:iterate tag, like
<logic:iterate id="vList" name="<%=Attributes.MY_LIST%>">
  <TR>
     <TD>
 	<html:checkbox property="mySelection" value="id"/>
     </TD>

  </TR>
</logic:iterate>

where:
*	<%=Attributes.MY_LIST%> is the name of the session attribute being an ArrayList
*	mySelection is the name of the String[] property I have defined into the ActionForm.


I appreciate very much any help!


Mihai Creanga
Software Developer


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org