Datamanager 2 simple select widget.

It can only be bound to a select type (or subclass thereof), and inherits the configuration from there as far as possible.

Available configuration options:

  • int height: The height of the select box, applies only for multiselect enabled boxes, the value is ignored in all other cases. Defaults to 6.
  • string othertext: The text that is used to separate the main from the other form element. They are usually displayed in the same line. The value is passed through the standard schema localization chain.
package midcom.helper.datamanager2


_on_initialize ()

The initialization event handler verifies the correct type.


booleanIndicating Success

add_elements_to_form ($attributes)

Adds a (multi)select widget to the form, depending on the base type config.



get_default ()

The defaults of the widget are mapped to the current selection.

render_content ()

sync_type_with_widget ($results)

The current selection is compatible to the widget value only for multiselects.

We need minor typecasting otherwise.





array $_all_elements

All elements in the select list.

saved for performance reasons.


\HTML_QuickForm_Select $_select_element

The select element in use.

This need separate tracking due to the potential group code. This makes tracking of empty return values much easier. It is populated during add_elements_to_form().


int $height

The height of the multi-select box, ignored if no multiple selection is allowed.

array $jsevents

JS actions bound to widget

string $othertext

l10n string id or direct text to use to separate the others input field from the main select.

Applies only for types which have allow_other set.