Class ComboBoxTag

  • All Implemented Interfaces:
    ConditionalTag, ListModelSupport, org.apache.commons.jelly.Tag

    public class ComboBoxTag
    extends InputComponentTag
    implements ListModelSupport

    A specific input component tag that creates a combo box component.

    A combo box displays a list of options from which the user can select one. The options to be displayed are obtained from a ListModel object, which is set either by a tag in this tag's body or by specifying the model's name in the modelRef attribute. A component handler that wraps a combo box must maintain a single data object of the same type as the list model (i.e. the return value of the model's getType() method).

    The following table lists all attributes that are supported by this tag (in addition to the default attributes that are allowed for all input component tags):

    Attribute Description Optional
    modelRef With this attribute the name of the list model can be supplied. It is then fetched from the current BeanContext. So a list model with this name must have been created before, either directly by the calling client or by another tag that has already been executed. If this attribute is not defined, a list model must be set by a nested tag. yes
    editable This boolean attribute determines whether the user can enter arbitrary text in the combo box's text field. If set to false , the user can only select one of the displayed options. For combo boxes that are editable the data value is not obtained from the list model, but will be the data entered by the user. yes

    Version:
    $Id: ComboBoxTag.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • ComboBoxTag

        public ComboBoxTag()
    • Method Detail

      • isEditable

        public boolean isEditable()
        Returns a flag whether this combo box is editable.
        Returns:
        the editable flag
      • setEditable

        public void setEditable​(boolean editable)
        Setter method of the editable attribute.
        Parameters:
        editable - the attribute value
      • getModelRef

        public String getModelRef()
        Returns the name of the model to use.
        Specified by:
        getModelRef in interface ListModelSupport
        Returns:
        the list model's name in the jelly context
      • setModelRef

        public void setModelRef​(String modelRef)
        Setter method of the modelRef attribute.
        Parameters:
        modelRef - the attribute value
      • setListModel

        public void setListModel​(ListModel model)
        Sets the list model for this combo box. This method is intended to be called by nested tags.
        Specified by:
        setListModel in interface ListModelSupport
        Parameters:
        model - the list model