Interface IComboitem

All Superinterfaces:
IChildrenOfInputgroup<IComboitem>, IComponent<IComboitem>, IDisable<IComboitem>, IHtmlBasedComponent<IComboitem>, ILabelElement<IComboitem>, ILabelImageElement<IComboitem>, IXulElement<IComboitem>

public interface IComboitem extends ILabelImageElement<IComboitem>, IDisable<IComboitem>
Immutable Comboitem component

An item of a combo box.

Author:
katherine
See Also:
  • Comboitem
  • Field Details

    • DEFAULT

      static final IComboitem DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.inp.Comboitem"

      Specified by:
      getWidgetClass in interface IComponent<IComboitem>
    • getDescription

      default String getDescription()
      Returns the description (never null). The description is used to provide extra information such that users is easy to make a selection.

      Default: "".

    • withDescription

      IComboitem withDescription(String description)
      Returns a copy of this immutable component with the specified description.

      Sets the description.

      Parameters:
      description - The description of the comboitem.

      Default: "".

      Returns:
      A modified copy of the this object
    • getContent

      default String getContent()
      Returns the embedded content (i.e., HTML tags) that is shown as part of the description.

      It is useful to show the description in more versatile way.

      Default: ""

      See Also:
    • withContent

      IComboitem withContent(String content)
      Returns a copy of this immutable component with the specified content.

      Sets the embedded content (i.e., HTML tags) that is shown as part of the description.

      It is useful to show the description in more versatile way.

      Default: "".

      Security Note

      Unlike other methods, the content assigned to this method is generated directly to the browser without escaping. Thus, it is better not to have something input by the user to avoid any XSS attach.

      Note: the content is sanitized by default to avoid XSS attack, and please don't use JavaScript in the content.

      Parameters:
      content - The embedded content of the comboitem to display

      Default: "".

      Returns:
      A modified copy of the this object
    • of

      static IComboitem of(String label)
      Returns the instance with the given label
      Parameters:
      label - The label of the comboitem
    • of

      static IComboitem of(String label, String image)
      Returns the instance with the given label and image
      Parameters:
      label - The label of the comboitem
      image - The image of the comboitem
    • ofImage

      static IComboitem ofImage(String image)
      Returns the instance with the given image
      Parameters:
      image - The image of the comboitem
    • ofId

      static IComboitem ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component