org.apache.wicket.extensions.markup.html.repeater.data.table.filter
Class ChoiceFilteredPropertyColumn

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn
      extended by org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn
          extended by org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilteredPropertyColumn
              extended by org.apache.wicket.extensions.markup.html.repeater.data.table.filter.ChoiceFilteredPropertyColumn
All Implemented Interfaces:
java.io.Serializable, ICellPopulator, IFilteredColumn, IColumn, IStyledColumn, org.apache.wicket.IClusterable, org.apache.wicket.model.IDetachable

public class ChoiceFilteredPropertyColumn
extends FilteredPropertyColumn

A filtered property column that creates a textfield filter component. The default model of the created textfield is a property model with the same property expression as the one used to display data. This works well when the filter state object is of the same type as the objects in the data table.

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

Constructor Summary
ChoiceFilteredPropertyColumn(org.apache.wicket.model.IModel displayModel, java.lang.String propertyExpression, org.apache.wicket.model.IModel filterChoices)
           
ChoiceFilteredPropertyColumn(org.apache.wicket.model.IModel displayModel, java.lang.String sortProperty, java.lang.String propertyExpression, org.apache.wicket.model.IModel filterChoices)
           
 
Method Summary
 void detach()
           
protected  boolean enableAutoSubmit()
          Returns true if the constructed choice filter should autosubmit the form when its value is changed.
protected  org.apache.wicket.markup.html.form.IChoiceRenderer getChoiceRenderer()
          Returns choice renderer that will be used to create the choice filter
 org.apache.wicket.Component getFilter(java.lang.String componentId, FilterForm form)
          Returns the component used by user to filter the column.
protected  org.apache.wicket.model.IModel getFilterChoices()
           
protected  org.apache.wicket.model.IModel getFilterModel(FilterForm form)
          Returns the model that will be passed on to the text filter.
 
Methods inherited from class org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn
createLabelModel, getPropertyExpression, populateItem
 
Methods inherited from class org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn
getCssClass, getDisplayModel, getHeader, getSortProperty, isSortable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn
getHeader, getSortProperty, isSortable
 
Methods inherited from interface org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator
populateItem
 

Constructor Detail

ChoiceFilteredPropertyColumn

public ChoiceFilteredPropertyColumn(org.apache.wicket.model.IModel displayModel,
                                    java.lang.String sortProperty,
                                    java.lang.String propertyExpression,
                                    org.apache.wicket.model.IModel filterChoices)
Parameters:
displayModel -
sortProperty -
propertyExpression -
filterChoices - collection choices used in the choice filter

ChoiceFilteredPropertyColumn

public ChoiceFilteredPropertyColumn(org.apache.wicket.model.IModel displayModel,
                                    java.lang.String propertyExpression,
                                    org.apache.wicket.model.IModel filterChoices)
Parameters:
displayModel -
propertyExpression -
filterChoices - collection of choices used in the choice filter
Method Detail

detach

public void detach()
Specified by:
detach in interface org.apache.wicket.model.IDetachable
Overrides:
detach in class AbstractColumn
See Also:
IDetachable.detach()

getFilter

public org.apache.wicket.Component getFilter(java.lang.String componentId,
                                             FilterForm form)
Description copied from interface: IFilteredColumn
Returns the component used by user to filter the column. If null is returned, no filter will be added.

Parameters:
componentId - component id for returned filter component
form - FilterForm object for the toolbar. components can use this form's model to access properties of the state object (PropertyModel(form.getModel(), "property") or retrieve the IFilterStateLocator object by using FilterForm.getStateLocator()
Returns:
component that will be used to represent a filter for this column, or null if no such component is desired
See Also:
IFilteredColumn.getFilter(java.lang.String, org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterForm)

getFilterModel

protected org.apache.wicket.model.IModel getFilterModel(FilterForm form)
Returns the model that will be passed on to the text filter. Users can override this method to change the model.

Parameters:
form - filter form
Returns:
model passed on to the text filter

enableAutoSubmit

protected boolean enableAutoSubmit()
Returns true if the constructed choice filter should autosubmit the form when its value is changed.

Returns:
true to make choice filter autosubmit, false otherwise

getChoiceRenderer

protected org.apache.wicket.markup.html.form.IChoiceRenderer getChoiceRenderer()
Returns choice renderer that will be used to create the choice filter

Returns:
choice renderer that will be used to create the choice filter

getFilterChoices

protected final org.apache.wicket.model.IModel getFilterChoices()
Returns:
filter choices model


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.