Class CheckGroupSelector

All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

Selects and deselects all Check components under the same CheckGroup as itself. Selection toggling is accomplished by generating an onclick javascript event handler. This component must be attached to markup of type <input type="checkbox"/>. Additionally, if CheckGroupSelector(String) constuctor is used the selector must be a descendant of the CheckGroup it is meant to affect.
Author:
Igor Vaynberg, Carl-Eric Menzel
See Also:
  • Constructor Details

    • CheckGroupSelector

      A Selector that will look for a CheckGroup in its parent hierarchy.
      Parameters:
      id - component id
    • CheckGroupSelector

      public CheckGroupSelector(String id, CheckGroup<?> group)
      A Selector that will work with the given group.
      Parameters:
      id - component id
      group - group to work with
  • Method Details

    • onBeforeRender

      protected void onBeforeRender()
      Description copied from class: Component
      Called on all visible components before any component is rendered.

      NOTE: If you override this, you *must* call super.onBeforeRender() within your implementation. Because this method is responsible for cascading Component.onBeforeRender() call to its children it is strongly recommended that super call is made at the end of the override.

      Changes to the component tree can be made only before calling super.onBeforeRender().
      Overrides:
      onBeforeRender in class Component
      See Also:
    • isEnabled

      public boolean isEnabled()
      Description copied from class: Component
      Gets whether this component is enabled. Specific components may decide to implement special behavior that uses this property, like web form components that add a disabled='disabled' attribute when enabled is false.
      Overrides:
      isEnabled in class Component
      Returns:
      Whether this component is enabled.
    • getFindCheckboxesFunction

      Find all checkboxes in the containing form with the same input name as the CheckGroup .
      Specified by:
      getFindCheckboxesFunction in class AbstractCheckSelector
      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.