to.etc.domui.component.meta
Annotation Type MetaCombo


@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
public @interface MetaCombo

Specifies how an object is shown when presented in a Combo Box. This annotation can be used on a class itself or on a property of a class type; the latter will "override" any class-level definition. Presence of this annotation at property level will also indicate a preference for a combobox over a Lookup form.

Author:
Frits Jalvingh Created on Jul 13, 2008

Optional Element Summary
 java.lang.Class<? extends IComboDataSet<?>> dataSet
          Define a class that will generate the data to show in the combo's list-of-values.
 java.lang.Class<? extends ILabelStringRenderer<?>> labelRenderer
           
 java.lang.Class<? extends INodeContentRenderer<?>> nodeRenderer
          Defines a custom node content renderer for the combobox's OPTION values.
 MetaComboProperty[] properties
          The list of properties that should be shown.
 

dataSet

public abstract java.lang.Class<? extends IComboDataSet<?>> dataSet
Define a class that will generate the data to show in the combo's list-of-values. The method called must return all data in the order to show because nothing sorts after. When unset this defaults to a generic "select all" query.

Returns:
Default:
to.etc.domui.component.meta.impl.UndefinedComboDataSet.class

labelRenderer

public abstract java.lang.Class<? extends ILabelStringRenderer<?>> labelRenderer
Returns:
Default:
to.etc.domui.util.UndefinedLabelStringRenderer.class

nodeRenderer

public abstract java.lang.Class<? extends INodeContentRenderer<?>> nodeRenderer
Defines a custom node content renderer for the combobox's OPTION values. This can be used when options need more than just text, like images or colors for instance. The renderer is responsible for generating the entire contents of an OPTION tag, and it gets passed the uncooked value to render (as obtained from the ComboComponentBase.getData() call). All other options in the annotation are useless once a custom renderer is used! If this is not used a content renderer is calculated from the other data in this annotation using MetaManager.createDefaultComboRenderer(PropertyMetaModel, ClassMetaModel).

Returns:
Default:
to.etc.domui.util.UndefinedLabelStringRenderer.class

properties

public abstract MetaComboProperty[] properties
The list of properties that should be shown. This is needed ONLY when the class metadata of the parent record does not specify a default display column or columnset. This usually shows a single property (because a combobox is not a table), but if multiple properties are used their values will be appended to form a single string separated by either a space, or the value of MetaComboProperty.join().

Returns:
Default:
{}