Interface ICellPopulator<T>
-
- Type Parameters:
T- Model object type
- All Superinterfaces:
org.apache.wicket.util.io.IClusterable,org.apache.wicket.model.IDetachable,Serializable
- All Known Subinterfaces:
IColumn<T,S>,IExportableColumn<T,S>,IFilteredColumn<T,S>,IStyledColumn<T,S>,ITreeColumn<T,S>
- All Known Implementing Classes:
AbstractColumn,AbstractExportableColumn,AbstractTreeColumn,ChoiceFilteredPropertyColumn,FilteredAbstractColumn,FilteredPropertyColumn,HeaderlessColumn,LambdaColumn,PropertyColumn,PropertyPopulator,TextFilteredPropertyColumn,TreeColumn
public interface ICellPopulator<T> extends org.apache.wicket.util.io.IClusterable, org.apache.wicket.model.IDetachable
Represents an object that is capable of populating anItemcontainer representing a cell in aDataGridViewwith components.Example
class NamePopulator implements ICellPopulator { void populateItem(final Item cellItem, final String componentId, final IModel rowModel) { User user=(User)rowModel.getObject(cellItem); String name=user.getFirstName()+" "+user.getLastName(); cellItem.add(new Label(componentId, name); }}In this example the IDataProvider assigned to the DataGridView retrieves User objects from the database. The cell populator adds a label to the cell that will display the full name of the user.- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
DataGridView,Item
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidpopulateItem(org.apache.wicket.markup.repeater.Item<ICellPopulator<T>> cellItem, String componentId, org.apache.wicket.model.IModel<T> rowModel)Method used to populate a cell in theDataGridViewImplementation MUST add a component to the cellItem using the component id provided by componentId argument, otherwise a WicketRuntimeException will be thrown
-
-
-
Method Detail
-
populateItem
void populateItem(org.apache.wicket.markup.repeater.Item<ICellPopulator<T>> cellItem, String componentId, org.apache.wicket.model.IModel<T> rowModel)
Method used to populate a cell in theDataGridViewImplementation MUST add a component to the cellItem using the component id provided by componentId argument, otherwise a WicketRuntimeException will be thrown- 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:
Item
-
-