Module org.apache.wicket.extensions
Class ChoiceFilteredPropertyColumn<T,Y,S>
java.lang.Object
org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn<T,S>
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn<T,S>
org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilteredPropertyColumn<T,S>
org.apache.wicket.extensions.markup.html.repeater.data.table.filter.ChoiceFilteredPropertyColumn<T,Y,S>
- Type Parameters:
T- The model object typeY- The column model object typeS- the type of the sort property
- All Implemented Interfaces:
Serializable,ICellPopulator<T>,IExportableColumn<T,,S> IFilteredColumn<T,,S> IColumn<T,,S> IStyledColumn<T,,S> IDetachable,org.apache.wicket.util.io.IClusterable
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:
-
Constructor Summary
ConstructorsConstructorDescriptionChoiceFilteredPropertyColumn(IModel<String> displayModel, String propertyExpression, IModel<? extends List<? extends Y>> filterChoices) ChoiceFilteredPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression, IModel<? extends List<? extends Y>> filterChoices) -
Method Summary
Modifier and TypeMethodDescriptionvoiddetach()protected booleanReturns true if the constructed choice filter should autosubmit the form when its value is changed.protected IChoiceRenderer<Y>Returns choice renderer that will be used to create the choice filtergetFilter(String componentId, FilterForm<?> form) Returns the component used by user to filter the column.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
getDataModel, getPropertyExpression, populateItemMethods inherited from class org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn
getCssClass, getDisplayModel, getHeader, getSortPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator
populateItemMethods inherited from interface org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn
getHeader, getHeaderColspan, getHeaderRowspan, getSortProperty, isSortableMethods inherited from interface org.apache.wicket.extensions.markup.html.repeater.data.table.export.IExportableColumn
getDisplayModel
-
Constructor Details
-
ChoiceFilteredPropertyColumn
public ChoiceFilteredPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression, IModel<? extends List<? extends Y>> filterChoices) - Parameters:
displayModel-sortProperty-propertyExpression-filterChoices- collection choices used in the choice filter
-
ChoiceFilteredPropertyColumn
public ChoiceFilteredPropertyColumn(IModel<String> displayModel, String propertyExpression, IModel<? extends List<? extends Y>> filterChoices) - Parameters:
displayModel-propertyExpression-filterChoices- collection of choices used in the choice filter
-
-
Method Details
-
detach
- Specified by:
detachin interfaceIDetachable- Overrides:
detachin classAbstractColumn<T,S> - See Also:
-
getFilter
Description copied from interface:IFilteredColumnReturns 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 componentform- 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 theIFilterStateLocatorobject by usingFilterForm.getStateLocator()- Returns:
- component that will be used to represent a filter for this column, or null if no such component is desired
- See Also:
-
getFilterModel
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
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
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
- Returns:
- filter choices model
-