Type Parameters:
T - The model object type
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IQueueRegion, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class ChoiceFilter<T> extends AbstractFilter
Filter that can be represented by a drop down list of choices
Author:
Igor Vaynberg (ivaynberg)
See Also:
  • Constructor Details

    • ChoiceFilter

      public ChoiceFilter(String id, IModel<T> model, FilterForm<?> form, IModel<? extends List<? extends T>> choices, boolean autoSubmit)
      Constructor.
      Parameters:
      id - component id
      model - model for the drop down choice component
      form - filter form this component will be attached to
      choices - list of choices, see DropDownChoice
      autoSubmit - if true this filter will submit the form on selection change
    • ChoiceFilter

      public ChoiceFilter(String id, IModel<T> model, FilterForm<?> form, List<? extends T> choices, boolean autoSubmit)
      Constructor
      Parameters:
      id - component id
      model - model for the drop down choice component
      form - filter form this component will be attached to
      choices - list of choices, see DropDownChoice
      autoSubmit - if true this filter will submit the form on selection change
    • ChoiceFilter

      public ChoiceFilter(String id, IModel<T> model, FilterForm<?> form, List<? extends T> choices, IChoiceRenderer<? super T> renderer, boolean autoSubmit)
      Constructor
      Parameters:
      id - component id
      model - model for the drop down choice component
      form - filter form this component will be attached to
      choices - list of choices, see DropDownChoice
      renderer - choice renderer, see DropDownChoice
      autoSubmit - if true this filter will submit the form on selection change
    • ChoiceFilter

      public ChoiceFilter(String id, IModel<T> model, FilterForm<?> form, IModel<? extends List<? extends T>> choices, IChoiceRenderer<? super T> renderer, boolean autoSubmit)
      Parameters:
      id - component id
      model - model for the drop down choice component
      form - filter form this component will be attached to
      choices - list of choices, see DropDownChoice
      renderer - choice renderer, see DropDownChoice
      autoSubmit - if true this filter will submit the form on selection change
      See Also:
  • Method Details

    • newDropDownChoice

      protected DropDownChoice<T> newDropDownChoice(String id, IModel<T> model, IModel<? extends List<? extends T>> choices, IChoiceRenderer<? super T> renderer)
      Factory method for the drop down choice component
      Parameters:
      id - component id
      model - component model
      choices - choices model
      renderer - choice renderer
      Returns:
      created drop down component
    • getChoice

      public final DropDownChoice<T> getChoice()
      Returns:
      the DropDownChoice form component created to represent this filter