|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn<U,KeyRing<U>>
org.ujorm.wicket.component.grid.KeyColumn<U,T>
public class KeyColumn<U extends Ujo,T>
A convenience implementation of column that adds a Ujo Property to the cell whose model is determined by
the provided wicket key expression (same as used by PropertyModel) that is evaluated
against the current row's model object
Example:
public class DataTablePage2 extends WebPage { public DataTablePage2() { final EmployeeProvider userProvider = new EmployeeProvider(); final List<IColumn> columns = new ArrayList<IColumn>(); columns.add(new KeyColumn(Employee.ID)); columns.add(new KeyColumn(Employee.FIRSTNAME)); columns.add(new KeyColumn(Employee.LASTNAME)); columns.add(new KeyColumn(Employee.EMAIL)); columns.add(new KeyColumn(Employee.STUDENT)); add(new DefaultDataTable("datatable", columns, userProvider, 20)); } }The above will attach a label to the cell with a key model for the expression "name.first"
KeyModel,
Serialized Form| Field Summary | |
|---|---|
protected String |
cssClass
The CSS class of the column |
protected KeyRing<U> |
keySerializable
Data key |
static String |
PROPERTY_PREFIX
Localization key prefix |
static boolean |
SORTING_OFF
Disable a grid column sorting |
static boolean |
SORTING_ON
Enable a grid column sorting |
| Constructor Summary | |
|---|---|
KeyColumn(org.apache.wicket.model.IModel<String> label,
KeyRing<U> key,
KeyRing<U> sortKey)
Creates a sortable key column |
|
KeyColumn(KeyRing<U> key,
KeyRing<U> sortKey)
Creates a sortable key column |
|
| Method Summary | ||
|---|---|---|
protected void |
appendCssClass(org.apache.wicket.Component value,
U ujo)
Append a CSS class - to overwriting only |
|
protected org.apache.wicket.Component |
createValueCoponent(String componentId,
org.apache.wicket.model.IModel<?> valueModel,
U ujo)
Create the Label for a Value component |
|
protected org.apache.wicket.model.IModel<?> |
createValueModel(U ujo)
Factory method for generating a model that will generated the displayed value. |
|
String |
getCssClass()
|
|
Key<U,T> |
getKey()
Get the Key |
|
String |
getPropertyExpression()
|
|
static
|
of(Key<U,T> key,
boolean sorted)
A factory method |
|
static
|
of(Key<U,T> key,
boolean sorted,
String cssClass)
A factory method |
|
static
|
of(Key<U,T> key,
Key<U,T> sort,
String cssClass)
A factory method |
|
void |
populateItem(org.apache.wicket.markup.repeater.Item<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<U>> item,
String componentId,
org.apache.wicket.model.IModel<U> rowModel)
Implementation of populateItem which adds a label to the cell whose model is the provided key expression evaluated against rowModelObject |
|
void |
setCssClass(String cssClass)
Assign a CSS class |
|
String |
toString()
Domain class + key |
|
| Methods inherited from class org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn |
|---|
detach, getDisplayModel, getHeader, getSortProperty, isSortable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean SORTING_ON
public static final boolean SORTING_OFF
public static final String PROPERTY_PREFIX
protected final KeyRing<U extends Ujo> keySerializable
protected String cssClass
| Constructor Detail |
|---|
public KeyColumn(KeyRing<U> key,
KeyRing<U> sortKey)
key - Ujorm key to display in the columnsortKey - Optional persistent ujorm key to sortingcssClass - optional argument for a CSS class
public KeyColumn(org.apache.wicket.model.IModel<String> label,
KeyRing<U> key,
KeyRing<U> sortKey)
label - Column labelkey - Ujorm key to display in the columnsortKey - Optional persistent ujorm key to sortingcssClass - optional argument for a CSS class| Method Detail |
|---|
public void populateItem(org.apache.wicket.markup.repeater.Item<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<U>> item,
String componentId,
org.apache.wicket.model.IModel<U> rowModel)
ICellPopulator.populateItem(Item, String, IModel)public String getCssClass()
getCssClass in interface org.apache.wicket.extensions.markup.html.repeater.data.table.IStyledColumn<U extends Ujo,KeyRing<U extends Ujo>>getCssClass in class org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn<U extends Ujo,KeyRing<U extends Ujo>>public void setCssClass(String cssClass)
protected org.apache.wicket.Component createValueCoponent(String componentId,
org.apache.wicket.model.IModel<?> valueModel,
U ujo)
protected org.apache.wicket.model.IModel<?> createValueModel(U ujo)
keySerializable specified in the constructor.
rowModel -
public String getPropertyExpression()
public Key<U,T> getKey()
protected void appendCssClass(org.apache.wicket.Component value,
U ujo)
public String toString()
toString in class Object
public static <U extends Ujo,T> KeyColumn<U,T> of(Key<U,T> key,
boolean sorted)
public static <U extends Ujo,T> KeyColumn<U,T> of(Key<U,T> key,
boolean sorted,
String cssClass)
public static <U extends Ujo,T> KeyColumn<U,T> of(Key<U,T> key,
Key<U,T> sort,
String cssClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||