Results 1 to 3 of 3

Thread: list box and multiple selections

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    109

    Default list box and multiple selections

    I've a requirement where in user needs to select multiple items from a drop-down/list box and the back-end will process those selections.

    Currently i'm displaying a select box and it allows only one selection.

    How can i change this to meet the above requirement.

    Please help.

  2. #2
    Join Date
    Aug 2006
    Location
    Brooklyn
    Posts
    556

    Default

    Use the form:select tag and set its path attribute to a list:

    Code:
    <form:select path="countries" items="${countryList}"/>
    The items attribute points to a list containing all countries, while the path points to a list on the command object containing currently selected ones.

    You'll most likely want to specify what to use for the option value/label:

    Code:
    <form:select path="countries" items="${countryList}" 
        itemValue="code" itemLabel="name" />

  3. #3
    Join Date
    Aug 2008
    Posts
    109

    Default

    Thanks Rossen. I will try implementing it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •