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


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

This describes how an Object is to be shown when it is displayed in a (Data)Table (see DataTable and BasicRowRenderer). The most important thing it does is to specify which properties of the object should be shown in columns of the table; every property mentioned in the defaultColumns() list becomes a column in the Table shown (provided the columns are not joined). In addition, this can also specify a default "sort" property; when set the table will be shown initially sorted on that property provided the data model supports sorting.

This annotation can be used on a class itself; then it defines the default wherever that class is used in a table. You can also add it to some property in which case it "overrides" the definition done at "class" level for tables that are shown using that single property. This has not yet been used so success is questionable...

Author:
Frits Jalvingh Created on Jul 28, 2008

Required Element Summary
 MetaDisplayProperty[] defaultColumns
          The list of properties to show in the table, and their conversion, display size etc characteristics.
 
Optional Element Summary
 java.lang.String defaultSortColumn
          Define a property to sort on by default.
 SortableType defaultSortOrder
          If a defaultSortColumn() is defined, this defines the initial sort direction (ascending, descending).
 MetaSearchItem[] searchProperties
          The list of properties to use as "search properties" in the lookup form and/or fast search shown when an instance is searched for.
 MetaDisplayProperty[] selectedProperties
          The list of properties that should be shown in the "display part" of a control like LookupInput when a single instance is selected.
 java.lang.Class<? extends INodeContentRenderer<?>> selectedRenderer
          Set to define your own renderer to render the display size of the field.
 

Element Detail

defaultColumns

public abstract MetaDisplayProperty[] defaultColumns
The list of properties to show in the table, and their conversion, display size etc characteristics. For a normal MetaObject instance this list should have at least 1 element.

Returns:

selectedRenderer

public abstract java.lang.Class<? extends INodeContentRenderer<?>> selectedRenderer
Set to define your own renderer to render the display size of the field. In that case you must render the complete data to show inside the control's display presentation, including the button to start searching. When you use this the data in #properties() is ignored.

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

selectedProperties

public abstract MetaDisplayProperty[] selectedProperties
The list of properties that should be shown in the "display part" of a control like LookupInput when a single instance is selected. If not present this defaults to the MetaObject properties for the target datatype.

Returns:
Default:
{}

searchProperties

public abstract MetaSearchItem[] searchProperties
The list of properties to use as "search properties" in the lookup form and/or fast search shown when an instance is searched for.

Returns:
Default:
{}

defaultSortColumn

public abstract java.lang.String defaultSortColumn
Define a property to sort on by default. Defaults to NONE, meaning the data is not sorted by the table. To set the default sort direction use defaultSortOrder().

Returns:
Default:
"$*$"

defaultSortOrder

public abstract SortableType defaultSortOrder
If a defaultSortColumn() is defined, this defines the initial sort direction (ascending, descending). It defaults to ascending.

Returns:
Default:
to.etc.domui.component.meta.SortableType.SORTABLE_ASC