SelectorWidget

From OpenCms Wiki
Jump to: navigation, search

Description

SelectorWidget allows selecting a single option from a drop-down list. For selecting multiple options at once, see MultiSelectWidget.

This value returned is a string, and the widget is typically employed for elements with type="OpenCmsString".

Configuration

Configuration is required, and must define the options, delimited by the pipe character (|).

The most basic configuration just defines the options:

<xsd:schema ...>
  ...
  <element name="MyElement" type="OpenCmsString" />
  ...
  <layout element="MyElement" widget="SelectorWidget" configuration="Small|Medium|Large" />
  ...
</xsd:schema>

Optionally, the displayed string and the return string (the actual stored value) may be defined separately:

  <layout element="MyElement" widget="SelectorWidget" configuration="S:Small|M:Medium|L:Large" />

Also optionally, the default option (initially the leftmost one) may be explicitly defined:

  <layout element="MyElement" widget="SelectorWidget" configuration="S:Small|M*:Medium|L:Large" />

Combining these syntax variations in a single configuration string is allowed—you may write e.g.:

  <layout element="ImagePosition" widget="SelectorWidget" configuration="Left|Right*|Before:Full width, before the text|After:Full width, after the text" />
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox