Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > multiple selection in jsp

Reply
Thread Tools

multiple selection in jsp

 
 
Vasu
Guest
Posts: n/a
 
      09-08-2006
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

 
Reply With Quote
 
 
 
 
Manish Pandit
Guest
Posts: n/a
 
      09-08-2006
You could use <logic:iterator> or <html:select> plus <htmlptions> to
iterate over the arraylist in your JSP.

-cheers,
Manish


Vasu wrote:
> 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


 
Reply With Quote
 
 
 
 
jiji
Guest
Posts: n/a
 
      09-08-2006
> 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.

 
Reply With Quote
 
Vasu
Guest
Posts: n/a
 
      10-05-2006
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">
<htmlresent name="addUserForm" parameter="Proposition">
<htmlptions collection="userProp" labelProperty="label"
property="value"/>
</html:select>

Let me know how to use the Parameter in htmlresent.

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()">

<htmlptions collection="userProp" labelProperty="label"
property="value"/>

</html:select>

will work for multiple selection.

kindly help.

thanks in advance.

Vasu
Manish Pandit wrote:
> You could use <logic:iterator> or <html:select> plus <htmlptions> to
> iterate over the arraylist in your JSP.
>
> -cheers,
> Manish
>
>
> Vasu wrote:
> > 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple selection in jsp using struts Vasu Java 0 10-09-2006 01:21 PM
multiple selection in jsp using struts Vasu Java 2 10-09-2006 04:40 AM
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
JTable with row selection, but no cell selection Simon Niederberger Java 2 01-07-2005 04:17 PM
JS comparing innerHTML to text selection (window.getSelection() /document.selection) Andrew Crowe HTML 1 09-13-2004 02:22 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57