wicket.extensions.markup.html.repeater.data.table
Class PropertyColumn

java.lang.Object
  extended bywicket.extensions.markup.html.repeater.data.table.AbstractColumn
      extended bywicket.extensions.markup.html.repeater.data.table.PropertyColumn
All Implemented Interfaces:
ICellPopulator, IColumn, java.io.Serializable
Direct Known Subclasses:
FilteredPropertyColumn

public class PropertyColumn
extends AbstractColumn

A convinience implementation of column that adds a label to the cell whose model is determined by the provided wicket property expression (same as used by PropertyModel) that is evaluated against the current row's model object

Example

 columns[0] = new PropertyColumn(new Model("First Name"), "name.first");
 
The above will attach a label to the cell with a property model for the expression "name.first"

Author:
Igor Vaynberg ( ivaynberg )
See Also:
PropertyModel, Serialized Form

Constructor Summary
PropertyColumn(wicket.model.IModel displayModel, java.lang.String propertyExpressions)
          Creates a non sortable property column
PropertyColumn(wicket.model.IModel displayModel, java.lang.String sortProperty, java.lang.String propertyExpression)
          Creates a property column that is also sortable
 
Method Summary
protected  wicket.model.IModel createLabelModel(wicket.model.IModel embeddedModel)
           
 java.lang.String getPropertyExpression()
           
 void populateItem(Item item, java.lang.String componentId, wicket.model.IModel model)
          Implementation of populateItem which adds a label to the cell whose model is the provided property expression evaluated agains rowModelObject
 
Methods inherited from class wicket.extensions.markup.html.repeater.data.table.AbstractColumn
getDisplayModel, getHeader, getSortProperty, isSortable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyColumn

public PropertyColumn(wicket.model.IModel displayModel,
                      java.lang.String sortProperty,
                      java.lang.String propertyExpression)
Creates a property column that is also sortable

Parameters:
displayModel - display model
sortProperty - sort property
propertyExpression - wicket property expression used by PropertyModel

PropertyColumn

public PropertyColumn(wicket.model.IModel displayModel,
                      java.lang.String propertyExpressions)
Creates a non sortable property column

Parameters:
displayModel - display model
propertyExpressions - wicket property expression
See Also:
PropertyModel
Method Detail

populateItem

public void populateItem(Item item,
                         java.lang.String componentId,
                         wicket.model.IModel model)
Implementation of populateItem which adds a label to the cell whose model is the provided property expression evaluated agains rowModelObject

Parameters:
item - 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)
model - the model of the row item being rendered. this model usually contains the model provided by the data provider.
See Also:
ICellPopulator.populateItem(Item, String, IModel)

createLabelModel

protected wicket.model.IModel createLabelModel(wicket.model.IModel embeddedModel)

getPropertyExpression

public java.lang.String getPropertyExpression()
Returns:
wicket property expression


Copyright © 2004-2008 Wicket developers. All Rights Reserved.