org.jboss.seam.annotations.selectitems
Annotation Type SelectItems


@Target(value={FIELD,METHOD})
@Retention(value=RUNTIME)
@Documented
@DataBinderClass(value=SelectItemsBinder.class)
public @interface SelectItems

Outjects a List to the same scope as the owning component, after wrapping items as a SelectItems. Note that the List will be re-wrapped and re-outjected each time the current component value is different to the value held by the context variable as determined by calling List.equals().

Author:
Jim Hazen

Optional Element Summary
 String descriptionMethod
          If specified, the method of this name will be called and its return value will be used to populate the SelectItem's description.
 String disabledMethod
          If specified, the method of this name will be called and its return value will be used to populate the SelectItem's disabled flag.
 String labelMethod
          If specified, the method of this name will be called and its return value will be used to populate the SelectItem's label.
 ScopeType scope
          Specifies the scope, for values which are not instances of a Seam component.
 String value
          The context variable name.
 String valueMethod
          If specified, the method of this name will be called and its return value will be used to populate the SelectItem's value.
 SelectItems.Strategy valueStrategy
           Choose a strategy for automatic value conversion.
 

value

public abstract String value
The context variable name. Defaults to the name of the annotated field or getter method.

Default:
""

valueMethod

public abstract String valueMethod
If specified, the method of this name will be called and its return value will be used to populate the SelectItem's value. The default is to use the objects index location in the list. This method must not take parameters and in order to avoid a problem with JSF components must either be a String or have a registered converter.

Returns:
The method to call for a custom value.
Default:
""

labelMethod

public abstract String labelMethod
If specified, the method of this name will be called and its return value will be used to populate the SelectItem's label. The default is to use the objects toString() return. This method must not take parameters and must return a String.

Returns:
The method to call for a custom label.
Default:
""

descriptionMethod

public abstract String descriptionMethod
If specified, the method of this name will be called and its return value will be used to populate the SelectItem's description. By default this value is not set. This method must not take parameters and must return a String.

Returns:
The method to call for a custom description.
Default:
""

disabledMethod

public abstract String disabledMethod
If specified, the method of this name will be called and its return value will be used to populate the SelectItem's disabled flag. By default this value is set to false. This method must not take parameters and must return a boolean.

Returns:
The method to call for a custom disabled value.
Default:
""

valueStrategy

public abstract SelectItems.Strategy valueStrategy
 Choose a strategy for automatic value conversion.  A value
 for valueMethod will override this strategy.
 
 INDEX (default) - Value is the index of the original list item.
 STRING - Value is the toString() representation of the item.
 OBJECT - Value is the original object, unconverted.  Use this option
 with caution.  Unless the value is a String or has a registered
 converter, JSF renderer will error out.
 

Returns:
The value conversion strategy.
Default:
INDEX

scope

public abstract ScopeType scope
Specifies the scope, for values which are not instances of a Seam component.

Default:
UNSPECIFIED