Class ListBox


  • public class ListBox
    extends ChoiceField

    A list box field

    • Method Detail

      • getAllowMultiSelect

        public boolean getAllowMultiSelect()

        Allow multiple items to be selected (Getter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • setAllowMultiSelect

        public void setAllowMultiSelect​(boolean value)

        Allow multiple items to be selected (Setter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
        java.lang.UnsupportedOperationException - if the document is read-only
      • getChosenItems

        public ChoiceItemList getChosenItems()

        The selected choice items (Getter)

        Adding to this list results in an error:

        • IllegalState
          • if the list has already been closed
          • if the choice field is marked a read-only
          • if this list is not empty and the list box field is not marked as multi-select
          • if the choice field has widgets
        • UnsupportedOperation if the document is read-only
        • IllegalArgument
          • if the given choice item is null
          • if the given choice item has already been closed
          • if the given choice item is already present in this list
          • if the given choice item does not belong to the list box field's choice items

        Removing items or clearing the list results in an IllegalState error if the form field is marked as read-only, or if it has widgets.

        Throws:
        java.lang.IllegalStateException - if the object has already been closed