widget:select

Purpose

Defines a single or multiple selection control, for example a dropdown list.

It may be associated with any writable property. In such case, selected item is sent to the corresponding property, and vice versa, i.e. when the value of the associated property changes, it is displayed on the list. If the mode attribute is set to 'mulitple', selected values appear separated by a comma.

The mcs-rows property set on widget:select allows authors to specify the size of the control.

Contains

Attribute groups

Attribute

Attribute Description Type Default Options Use
mode Specifies single or multiple selection control xs:string single  multiple, single  optional 

Action

Action Description
clear-value Clears selected value

Property

Property Description Type Access
value Contains the value of the selected item. If it is associated with a property, the value of this property is a mirror of the corresponding property value. When the mode attribute is set to 'mulitple', selected values appear separated by comma. xs:string read/write 

Example

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:widget="http://www.volantis.com/xmlns/2006/05/widget">
  <head>
    <title>widget:option</title>
  </head>
  <body>
    <div>
      <span>Select:</span>
      <widget:select>
        <widget:option value="Berlin">Berlin</widget:option>
        <widget:option value="Budapest">Budapest</widget:option>
        <widget:option value="Prague">Prague</widget:option>
        <widget:option value="Vienna">Vienna</widget:option>
      </widget:select>
    </div>
  </body>
</html>

Related topics