PropertySelection Component Index SelectionField

wml:Select
org.apache.tapestry.wml.Select
Image Component
 
Description
The wml:Select component lets users pick from a list of options. Each option is specified by an wml:Option component. Each Option element may have one line of formatted text (which may be wrapped or truncated by the user agent if too long).
See Also
wml:Go, wml:Option
Parameters
Name Type Direction Required Default Description
multiple boolean in no   This attribute specifies a title for this element, which may be used in the presentation of this object. This attribute specifies a title for this element, which may be used in the presentation of this object.
name String in no   The name attribute indicates the name of the variable to set with the result of the selection. The variable is set to the string value of the chosen option element, which is specified with the value attribute. The name variable's value is used to pre-select options in the select list.
value String in no   The value attribute indicates the default value of the variable named in the name attribute. When the element is displayed, and the variable named in the name attribute is not set, the name variable may be assigned the value specified in the value attribute, depending on the values defined in iname and ivalue. If the name variable already contains a value, the value attribute is ignored. Any application of the default value is done before the list is pre-selected with the value of the name variable. If this element allows the selection of multiple options, the result of the user's choice is a list of all selected values, separated by the semicolon character. The name variable is set with this result. In addition, the value attribute is interpreted as a semicolon-separated list of pre-selected options.

Body: removed
Informal parameters: allowed
Reserved parameters: none

Example

This example show how to use a WML Select and Option components. Because of simplicity we recommend to use the wml:PropertySelection component.

WML Image Example

Template

<card jwcid="@wml:Card" id="incomecard">
 <p>
  How much do you make?
  <select jwcid="incomeSelect@wml:Select" name="ognl:components.income.varName" title="income">
   <option jwcid="@wml:Option" value="$10-50K"> $$10-25K </option>
   <option jwcid="@wml:Option" value="$25-50K"> $$25-50K </option>
   <option jwcid="@wml:Option" value="$50-100K"> $$50-100K </option>
   <option jwcid="@wml:Option" value="Over $100K"> Over $$100K </option>
  </select>
 </p>
</card>

Specification

<page-specification class="org.apache.tapestry.junit.mock.wml.Select">
 <property-specification name="income" type="java.lang.String" persistent="yes"/>
</page-specification>


PropertySelection Component Index SelectionField