multiple selection in jsp

Discussion in 'Java' started by Vasu, Sep 8, 2006.

  1. Vasu

    Vasu Guest

    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
    Vasu, Sep 8, 2006
    #1
    1. Advertising

  2. You could use <logic:iterator> or <html:select> plus <html:eek:ptions> 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
    Manish Pandit, Sep 8, 2006
    #2
    1. Advertising

  3. Vasu

    jiji Guest

    > 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.
    jiji, Sep 8, 2006
    #3
  4. Vasu

    Vasu Guest

    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:eek:ptions 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:eek:ptions 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 <html:eek:ptions> 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
    Vasu, Oct 5, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Niederberger
    Replies:
    2
    Views:
    16,419
    Christian Kaufhold
    Jan 7, 2005
  2. Andrew Crowe
    Replies:
    1
    Views:
    4,438
    Andrew Crowe
    Sep 13, 2004
  3. Replies:
    0
    Views:
    4,325
  4. Vasu
    Replies:
    2
    Views:
    4,612
  5. Vasu
    Replies:
    0
    Views:
    541
Loading...

Share This Page