Package org.zkoss.stateless.state

## Interface ItemController<DataT,​ModelT,​P extends IComponent,​ItemT>

- All Known Implementing Classes:
    `IBiglistboxController`, `ICascaderController`, `IChosenboxController`, `IComboboxController`, `IGridController`, `ILinelayoutController`, `IListboxController`, `IOrganigramController`, `IRadiogroupController`, `ISearchboxController`, `ISelectboxController`, `IStepbarController`, `ITabboxController`, `ITreeController`

      public interface ItemController<DataT,​ModelT,​P extends IComponent,​ItemT>

  An interface for controlling model to build items, such as `ListModel`.
  Author:
    jumperchen

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `P` | `build()` | Returns the immutable instance that the controller to build with
    `void` | `clear()` | Clears all the rendered data.
    `ModelT` | `getModel()` | Returns the model, which is set through by `setModel(Object)`, or null.
    `CheckedFunction2<DataT,​java.lang.Integer,​ItemT>` | `getRenderer()` | Returns the renderer, which is set through by `setRenderer(CheckedFunction2)`, or a default one which is depended on implementation.
    `void` | `setModel​(ModelT model)` | Sets the given model to this controller.
    `void` | `setRenderer​(CheckedFunction2<DataT,​java.lang.Integer,​ItemT> renderer)` | Sets the renderer which is used to render each data if `getModel()` is not null.

- - ### Method Detail

    - #### setModel

          void setModel​(@Nullable
                        ModelT model)

      Sets the given model to this controller.

      Note: calling this method after `build()`, you should invoke `build()` again to take effect to replace the current one at client.
      For example,

           uiAgent.replaceWith(locator, itemController.build());

      Default: `null`

    - #### getModel

          @Nullable
          ModelT getModel()

      Returns the model, which is set through by `setModel(Object)`, or null.

    - #### setRenderer

          void setRenderer​(CheckedFunction2<DataT,​java.lang.Integer,​ItemT> renderer)

      Sets the renderer which is used to render each data if `getModel()` is not null.

      Note: calling this method after `build()`, you should invoke `build()` again to take effect to replace the current one at client.
      For example,

           uiAgent.replaceWith(locator, itemController.build());

      Default: `null`, or depended on the implementation

    - #### getRenderer

          CheckedFunction2<DataT,​java.lang.Integer,​ItemT> getRenderer()

      Returns the renderer, which is set through by `setRenderer(CheckedFunction2)`, or a default one which is depended on implementation.

    - #### build

          P build()

      Returns the immutable instance that the controller to build with

    - #### clear

          void clear()

      Clears all the rendered data.