wicket.contrib.phonebook.web
Class CheckBoxColumn<T>

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn<T>
      extended by org.apache.wicket.extensions.markup.html.repeater.data.table.HeaderlessColumn<T>
          extended by wicket.contrib.phonebook.web.CheckBoxColumn<T>
All Implemented Interfaces:
Serializable, org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<T>, org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<T>, org.apache.wicket.extensions.markup.html.repeater.data.table.IStyledColumn<T>, org.apache.wicket.IClusterable, org.apache.wicket.model.IDetachable

public abstract class CheckBoxColumn<T>
extends org.apache.wicket.extensions.markup.html.repeater.data.table.HeaderlessColumn<T>

Checkbox column for DataTable

Author:
ivaynberg
See Also:
CheckBoxModel, Serialized Form

Constructor Summary
CheckBoxColumn(org.apache.wicket.model.IModel<Collection<Serializable>> selectionModel)
          Constructor
 
Method Summary
protected abstract  Serializable getModelObjectToken(org.apache.wicket.model.IModel<T> model)
          Generates a token from the model object that will represent the selected state of this row.
 void populateItem(org.apache.wicket.markup.repeater.Item<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<T>> cellItem, String componentId, org.apache.wicket.model.IModel<T> rowModel)
           
 
Methods inherited from class org.apache.wicket.extensions.markup.html.repeater.data.table.HeaderlessColumn
getHeader
 
Methods inherited from class org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn
detach, getCssClass, getDisplayModel, getSortProperty, isSortable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckBoxColumn

public CheckBoxColumn(org.apache.wicket.model.IModel<Collection<Serializable>> selectionModel)
Constructor

Parameters:
selectionModel - model that represents a collection of selected tokens generated by getModelObjectToken(IModel). Usually this collection is a Set of primary keys.
Method Detail

populateItem

public void populateItem(org.apache.wicket.markup.repeater.Item<org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator<T>> cellItem,
                         String componentId,
                         org.apache.wicket.model.IModel<T> rowModel)

getModelObjectToken

protected abstract Serializable getModelObjectToken(org.apache.wicket.model.IModel<T> model)
Generates a token from the model object that will represent the selected state of this row. The implementation should usually return a primary key of the object inside the provided model. Example: return ((User)model.getObject()).getId();

Parameters:
model - model that contains an object bound to current row of the table
Returns:
a token which will uniquely identify the selection of this row


Copyright © 2005-2012 Wicket developers. All Rights Reserved.