Hi
Iam using struts framework for our project. I have a jsp in which
multiple selection can be made in a list box. While submitting, the
action class is called that perfomrs some operations.
The list box is populated from database. The multiple selected values
are put into an arraylist in the action class.
is there anything i have to do in struts-config.xml to ahndle
selections?
Please reply.
Thanks & Regards,
Vasu
Manish Pandit - 08 Sep 2006 06:25 GMT
You could use <logic:iterator> or <html:select> plus <html:options> to
iterate over the arraylist in your JSP.
-cheers,
Manish
> Hi
>
[quoted text clipped - 12 lines]
> Thanks & Regards,
> Vasu
Vasu - 05 Oct 2006 13:02 GMT
thanks Manish.
<bean:define id="userProp" name="addUserForm"
property="userPropositions" />
<html:select property="selProposition" multiple="true"
name="addUserForm" onchange="showProposition()">
<html:iterate name="addUserForm" property="userProp"
id="userAssociatedPropositions">
<html:present name="addUserForm" parameter="Proposition">
<html:options collection="userProp" labelProperty="label"
property="value"/>
</html:select>
Let me know how to use the Parameter in html:present.
The arraylist that has the values has been converted into a string[]
that struts supports fro multiple selection.
i found in one of the mail archieves in google that
<bean:define id="userProp" name="addUserForm"
property="userPropositions" />
<html:select property="selProposition" multiple="true"
name="addUserForm" onchange="showProposition()">
<html:options collection="userProp" labelProperty="label"
property="value"/>
</html:select>
will work for multiple selection.
kindly help.
thanks in advance.
Vasu
> You could use <logic:iterator> or <html:select> plus <html:options> to
> iterate over the arraylist in your JSP.
[quoted text clipped - 18 lines]
> > Thanks & Regards,
> > Vasu
jiji - 08 Sep 2006 14:18 GMT
> is there anything i have to do in struts-config.xml to ahndle
> selections?
there is no specific configurations for list (or multiple selection) in
struts-config.xml.