Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

multiple selection in jsp

Thread view: 
Vasu - 08 Sep 2006 05:57 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.