org.apache.wicket.extensions.markup.html.repeater.data.grid
Class PropertyPopulator<T>

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.data.grid.PropertyPopulator<T>
Type Parameters:
T -
All Implemented Interfaces:
java.io.Serializable, ICellPopulator<T>, IClusterable, IDetachable

public class PropertyPopulator<T>
extends java.lang.Object
implements ICellPopulator<T>

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:
Serialized Form

Constructor Summary
PropertyPopulator(java.lang.String property)
          Constructor
 
Method Summary
 void detach()
          Detaches model after use.
 void populateItem(Item<ICellPopulator<T>> cellItem, java.lang.String componentId, IModel<T> rowModel)
          Method used to populate a cell in the DataGridView Implementation MUST add a component to the cellItem using the component id provided by componentId argument, otherwise a WicketRuntimeException will be thrown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyPopulator

public PropertyPopulator(java.lang.String property)
Constructor

Parameters:
property - property whose value will be displayed in the cell. uses wicket's PropertyModel notation.
Method Detail

detach

public void 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 interface IDetachable
See Also:
IDetachable.detach()

populateItem

public void populateItem(Item<ICellPopulator<T>> cellItem,
                         java.lang.String componentId,
                         IModel<T> rowModel)
Description copied from interface: ICellPopulator
Method used to populate a cell in the DataGridView 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 interface ICellPopulator<T>
Parameters:
cellItem - the item representing the current table cell being rendered
componentId - 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:
ICellPopulator.populateItem(org.apache.wicket.markup.repeater.Item, java.lang.String, org.apache.wicket.model.IModel)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.