You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "White, Joshua A (HTSC, CASD)" <Jo...@thehartford.com> on 2003/07/28 13:20:37 UTC
Beginner html:multibox help
I would like to generate a list of check boxes from a collection but
determine if the checkbox is checked using a String[]. How could this be
done? The following code does not work, but shows what I have tried.
Regards,
Joshua
<FormBean>
...
private String[] userSelectedState;
public void setUserSelectedState(String[] userSelectedState) {
...
}
public String[] getUserSelectedState() {
...
}
public Collection getAllStatesFromDb() {
...
}
...
</FormBean>
<JSP>
...
<logic:iterate id="state" name="myForm" property="allStatesFromDb">
<bean:define id="stateId" name="state" property="stateId"
scope="page" toScope="page"/>
<html:multibox property="userSelectedState"
value="<%=stateId%>"/>
<bean:write name="state" property="stateDescription"
filter="false"/><br>
</logic:iterate>
...
</JSP>
This communication, including attachments, is for the exclusive use of
addressee and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, any use, copying,
disclosure, dissemination or distribution is strictly prohibited. If
you are not the intended recipient, please notify the sender
immediately by return email and delete this communication and destroy all copies.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org