Class ListBoxField

    • Constructor Detail

      • ListBoxField

        public ListBoxField​(java.lang.String id,
                            int size,
                            boolean allowMultipleSelection)
        Create a new list box field.
        Parameters:
        size - the size of the list box, which will define the height of visible properties, shall be greater than zero
        allowMultipleSelection - a boolean flag that defines whether multiple options are allowed to be selected at once
        id - the id
    • Method Detail

      • getDefaultProperty

        public <T1> T1 getDefaultProperty​(int property)
        Description copied from class: FormField
        Gets the default property from this entity.
        Specified by:
        getDefaultProperty in interface IPropertyContainer
        Overrides:
        getDefaultProperty in class FormField<AbstractSelectField>
        Type Parameters:
        T1 - the return type associated with the property
        Parameters:
        property - the property to be retrieved
        Returns:
        the default property value. If the default property is not defined, null will be returned
      • addOption

        public ListBoxField addOption​(java.lang.String option)
        Add an option for ListBoxField. The option is not selected.
        Parameters:
        option - string representation of the option.
        Returns:
        this ListBoxField.
      • addOption

        public ListBoxField addOption​(java.lang.String option,
                                      boolean selected)
        Add an option for ListBoxField.
        Parameters:
        option - string representation of the option.
        selected - true is the option if selected, false otherwise.
        Returns:
        this ListBoxField.
      • getSelectedStrings

        public java.util.List<java.lang.String> getSelectedStrings()
        Get a list of selected options.
        Returns:
        a list of display values of selected options.
      • setTopIndex

        public ListBoxField setTopIndex​(int topIndex)
        Sets the index of the first visible option in a scrollable list.
        Parameters:
        topIndex - the index of the first option
        Returns:
        this ListBoxField instance