Gugan Mohan
Gugan Mohan

Reputation: 1645

Equivalent for select tag with choose multiple options in struts

Hi I want to know the equivalent code in struts.

    <-select->
       <-option value="a"-> a <-/option->
       <-option value="b"-> b <-/option->
       <-option value="c"-> c <-/option->
       <-option value="d"-> d <-/option->
    <-/select->

we can represent the above in struts as

    <-sj:select-><-/sj:select->

Like that how to represent the following code that allows to select "multiple" values.

    <-select multiple="multiple"->
       <-option value="a"-> a <-/option->
       <-option value="b"-> b <-/option->
       <-option value="c"-> c <-/option->
       <-option value="d"-> d <-/option->
    <-/select->

I tried this. But no use.

    <-sj:select multiple="multiple"-><-/sj:select->

TIA.

Upvotes: 0

Views: 845

Answers (1)

JB Nizet
JB Nizet

Reputation: 691933

The tags are documented:

multiple - required: false - default: false - evaluated: false - type: Boolean

Creates a multiple select. The tag will pre-select multiple values if the values are passed as an Array or a Collection(of appropriate types) via the value attribute. If one of the keys equals one of the values in the Collection or Array it wil be selected

Upvotes: 1

Related Questions