Module org.apache.wicket.extensions
Class PropertyPopulator<T>
java.lang.Object
org.apache.wicket.extensions.markup.html.repeater.data.grid.PropertyPopulator<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
Serializable
,ICellPopulator<T>
,IDetachable
,IClusterable
A convenience implementation of
ICellPopulator
that adds a label that will display the
value of the specified property. Non-string properties will be converted to a string before
display.
Example
ICellPopulator cityPopulator = new PropertyPopulator("address.city");
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
detach()
Detaches model after use.void
populateItem
(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) Method used to populate a cell in theDataGridView
Implementation MUST add a component to the cellItem using the component id provided by componentId argument, otherwise a WicketRuntimeException will be thrown
-
Constructor Details
-
PropertyPopulator
Constructor- Parameters:
property
- property whose value will be displayed in the cell. uses wicket'sPropertyModel
notation.
-
-
Method Details
-
detach
Description copied from interface:IDetachable
Detaches model after use. This is generally used to null out transient references that can be re-attached later.- Specified by:
detach
in interfaceIDetachable
- See Also:
-
populateItem
Description copied from interface:ICellPopulator
Method used to populate a cell in theDataGridView
Implementation MUST add a component to the cellItem using the component id provided by componentId argument, otherwise a WicketRuntimeException will be thrown- Specified by:
populateItem
in interfaceICellPopulator<T>
- Parameters:
cellItem
- the item representing the current table cell being renderedcomponentId
- the id of the component used to render the cell (only one component should be added to the cell)rowModel
- the model of the row item being rendered. this model usually contains the model provided by the data provider.- See Also:
-