Class AbstractCheckSelector

All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
CheckboxMultipleChoiceSelector, CheckBoxSelector, CheckGroupSelector

public abstract class AbstractCheckSelector extends LabeledWebMarkupContainer implements IHeaderContributor
Base class for all Javascript-based "select-all" checkboxes. Provides a simple "select all" checkbox which can be automatically updated based on the selection state of the checkboxes it controls (see wantAutomaticUpdate()).
Author:
Carl-Eric Menzel
See Also:
  • Constructor Details

  • Method Details

    • wantAutomaticUpdate

      protected boolean wantAutomaticUpdate()
      Returns:
      Whether the individual checkboxes should update the state of the Selector. If true, then when a checkbox is clicked, the state of all checkboxes is tested - if all are checked, the selector is checked too. If not, the selector is unchecked.
    • renderHead

      public void renderHead(IHeaderResponse response)
      Description copied from class: Component
      Render to the web response whatever the component wants to contribute to the head section.
      Specified by:
      renderHead in interface IHeaderContributor
      Overrides:
      renderHead in class Component
      Parameters:
      response - Response object
    • onComponentTag

      protected void onComponentTag(ComponentTag tag)
      Description copied from class: Component
      Processes the component tag. Overrides of this method most likely should call the super implementation.
      Overrides:
      onComponentTag in class Component
      Parameters:
      tag - Tag to modify
    • getFindCheckboxesFunction

      Concrete subclasses must override this to provide a Javascript function that returns the IDs of all checkboxes that should be controlled by this selector.
      Returns:
      a String containing a Javascript expression that evaluates to a function(!). This function must return an array containing the IDs of all checkbox input elements that this selector should control.