Package org.zkoss.stateless.sul

## Interface ISearchbox

- All Superinterfaces:
    `IAnyGroup<ISearchbox>`, `IComponent<ISearchbox>`, `IDisable<ISearchbox>`, `IHtmlBasedComponent<ISearchbox>`

      public interface ISearchbox
      extends IHtmlBasedComponent<ISearchbox>, IDisable<ISearchbox>, IAnyGroup<ISearchbox>

  Immutable `Searchbox` component.

  A dropdown list that allows users to search and select items.

  ### Support @Action

  Name | Action Type
  --- | ---
  onSelect | ActionData: `SelectData` Represents an action caused by user's the selection changed at the client.
  onOpen | ActionData: `OpenData` Represents an action that indicates an open state that is changed at the client.
  onSearching | ActionData: `InputData` Represents an action sent back to the server caused by user's input text.

  ## Mouseless Entry

  - `UP` or `DOWN` to pop up the list if being focused.
  - `ESC` to close the list.
  - `UP`, `DOWN`, `HOME`, `END`, `PAGE UP` and `PAGE DOWN` to change the selection of the item from the list.
  - `ENTER` to confirm the change of selection.
  - `DELETE` or `BACKSPACE` to clear the selection.
  Author:
    katherine
  See Also:
    `Searchbox`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `ISearchbox.Builder` | Builds instances of type `ISearchbox`.
    `static class` | `ISearchbox.Updater` | Builds an updater of type `ISearchbox` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static ISearchbox` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getPlaceholder()` | Returns the placeholder text.
    `java.lang.String` | `getSearchMessage()` | Returns the placeholder message of the search text field, or null to use the default message.
    `java.lang.String` | `getSearchText()` | Returns the value of the search text
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isAutoclose()` | Returns whether to automatically close the list if a user is selected any item.
    `default boolean` | `isMultiple()` | Returns whether multiple selections are allowed.
    `default boolean` | `isOpen()` | Returns whether this searchbox is open.
    `static ISearchbox` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `ISearchbox` | `withAutoclose​(boolean autoclose)` | Returns a copy of `this` immutable component with the specified `autoclose`.
    `ISearchbox` | `withMultiple​(boolean multiple)` | Returns a copy of `this` immutable component with the specified `multiple`.
    `ISearchbox` | `withOpen​(boolean open)` | Returns a copy of `this` immutable component with the specified `open`.
    `ISearchbox` | `withPlaceholder​(java.lang.String placeholder)` | Returns a copy of `this` immutable component with the specified `placeholder`.
    `ISearchbox` | `withSearchMessage​(java.lang.String searchMessage)` | Returns a copy of `this` immutable component with the specified `searchMessage`.
    `ISearchbox` | `withSearchText​(java.lang.String searchText)` | Returns a copy of `this` immutable component with the specified `searchText`.

    - ### Methods inherited from interface org.zkoss.stateless.sul.IComponent

      `getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IDisable

      `isDisabled, withDisabled`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex`

- - ### Field Detail

    - #### DEFAULT

          static final ISearchbox DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zkmax.inp.Searchbox"`

      Specified by:
        `getWidgetClass` in interface `IComponent<ISearchbox>`
      Returns:

    - #### getSearchMessage

          @Nullable
          java.lang.String getSearchMessage()

      Returns the placeholder message of the search text field, or null to use the default message.

    - #### withSearchMessage

          ISearchbox withSearchMessage​(@Nullable
                                       java.lang.String searchMessage)

      Returns a copy of `this` immutable component with the specified `searchMessage`.

      Sets the placeholder message of the search text field.

      Parameters:
        `searchMessage` - The placeholder message of the search text field

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getPlaceholder

          @Nullable
          java.lang.String getPlaceholder()

      Returns the placeholder text.

      Default: `null`

    - #### withPlaceholder

          ISearchbox withPlaceholder​(@Nullable
                                     java.lang.String placeholder)

      Returns a copy of `this` immutable component with the specified `placeholder`.

      Sets the placeholder text that is displayed when the selected item is empty.

      Parameters:
        `placeholder` - The placeholder text that is displayed when the selected item is empty.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### isMultiple

          default boolean isMultiple()

      Returns whether multiple selections are allowed.

      Default: `false`.

    - #### withMultiple

          ISearchbox withMultiple​(boolean multiple)

      Returns a copy of `this` immutable component with the specified `multiple`.

      Sets whether multiple selections are allowed.

      Notice that, if a model is assigned, it will change the model's state (by `Selectable.setMultiple(boolean)`).

      Parameters:
        `multiple` - Whether multiple selections are allowed.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isOpen

          default boolean isOpen()

      Returns whether this searchbox is open.

      Default: `false`.

    - #### withOpen

          ISearchbox withOpen​(boolean open)

      Returns a copy of `this` immutable component with the specified `open`.

      Sets whether to open or not for the searchbox.

      Parameters:
        `open` - Whether to open or not for the searchbox

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isAutoclose

          default boolean isAutoclose()

      Returns whether to automatically close the list if a user is selected any item.

      Default: `false`

    - #### withAutoclose

          ISearchbox withAutoclose​(boolean autoclose)

      Returns a copy of `this` immutable component with the specified `autoclose`.

      Sets whether to automatically close the list if a user is selected any item.

      Parameters:
        `autoclose` - Whether to automatically close the list if a user is selected any item.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### getSearchText

          @Nullable
          java.lang.String getSearchText()

      Returns the value of the search text
      Since:
        10.2.0

    - #### withSearchText

          ISearchbox withSearchText​(@Nullable
                                    java.lang.String searchText)

      Returns a copy of `this` immutable component with the specified `searchText`. Sets the value of the search text.
      Returns:
        A modified copy of the `this` object
      Since:
        10.2.0

    - #### ofId

          static ISearchbox ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component