wheel.components
Interface IEnhancingSelectModel

All Superinterfaces:
ISelectModel

public interface IEnhancingSelectModel
extends ISelectModel

This interface makes it possible to add additional components before and after the generated input element. Useful with CheckboxGroup and RadioGroup when you want to customize the way the form input elements are created.

Author:
Henri Frilund

Method Summary
 RenderableComponent renderAfter(RenderableComponent component, int index, boolean selected)
          A callback method that is called to enable adding components that will be rendered after the input element.
 RenderableComponent renderBefore(RenderableComponent component, int index, boolean selected)
          A callback method that is called to enable adding components that will be rendered before the input element.
 java.lang.String renderHint(RenderableComponent component, int index, boolean selected)
          Allows you to add render hints to the input element.
 
Methods inherited from interface wheel.components.ISelectModel
getLabel, getObjects, getOptionCount, getValue, translateValue
 

Method Detail

renderBefore

RenderableComponent renderBefore(RenderableComponent component,
                                 int index,
                                 boolean selected)
A callback method that is called to enable adding components that will be rendered before the input element. To create a component that will be rendered before the input element, use component.createXXX(); Method.
Example:
 public RenderableComponent renderBefore(RenderableComponent component, int index, boolean selected) {
      return component.createLabel("h4", "Select me");
 }
 

Parameters:
component - The input element that was genereated based on the ISelectModel
index - At what index are we at
selected - Is this the selected element
Returns:
The component to render before the input element

renderAfter

RenderableComponent renderAfter(RenderableComponent component,
                                int index,
                                boolean selected)
A callback method that is called to enable adding components that will be rendered after the input element. To create a component that will be rendered after the input element, use component.createXXX(); Method.

Parameters:
component - The input element that was genereated based on the ISelectModel
index - At what index are we at
selected - Is this the selected element
Returns:
The component to render after the input element

renderHint

java.lang.String renderHint(RenderableComponent component,
                            int index,
                            boolean selected)
Allows you to add render hints to the input element.
Example, you want to change the class to "selected" for the input element that refers to the selected object.
 public String renderHint(RenderableComponent component, int index, boolean selected) {
      String result = "";

      if (selected)
          result = "selected";

      return result;
 }
 

Parameters:
component - The input element that was genereated based on the ISelectModel
index - At what index are we at
selected - Is this the selected element
Returns:
A render hint String to be added to the generated input element,


Copyright © 2007-2008. All Rights Reserved.