Class IComboboxController<Data>

    • Method Detail

      • setModel

        public void setModel​(ListModel<Data> model)
        Sets the list model associated with this combobox. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render.
        Specified by:
        setModel in interface ItemController<Data,​ListModel<Data>,​ICombobox,​IComboitem>
        Parameters:
        model - the list model to associate, or null to dissociate any previous model.
        Throws:
        UiException - if failed to initialize with the model
      • setInvalidateThreshold

        public void setInvalidateThreshold​(int invalidateThreshold)
        Sets the threshold number of changed items of a model to invalidate a widget's DOM elements

        Default: 10

        Parameters:
        invalidateThreshold - The threshold number
      • getSelectedObject

        public Data getSelectedObject()
        Returns the data object which is selected or null.

        Default: null

      • setSelectedObject

        public void setSelectedObject​(Data data)
        Sets the selected data object, or deselects it by passing a null value.
        Parameters:
        data - The data object that contains in the model.
      • getSelectedIndex

        public int getSelectedIndex()
        Returns the index of the selected item, or -1 if not selected.
      • setSelectedIndex

        public void setSelectedIndex​(int index)
        Deselects the currently selected items and selects the item with the given index.

        Note: if the data has the same more than one, the first data item will be selected at client side, it is a limitation of ICombobox and it is different from IListbox.