NestedCheckboxList

/libs/granite/ui/components/coral/foundation/form/nestedcheckboxlist

NestedCheckboxList is a tree of checkboxes. When a checkbox is checked/unchecked:

  • Its descendant checkboxes are checked/unchecked also (i.e. the check/uncheck all concept)
  • Its ancestor checkboxes are updated to reflect theirs immediate children check status. When all the children are not checked/unchecked, the checkbox’s will be rendered as partially checked.

It has the following content structure:

granite:FormNestedCheckboxList
  1. granite:commonAttrs
  2. granite:renderCondition
  3. granite:container
disconnectedboolean

true to make each checkbox change to avoid checking/unchecking other checkboxes.

Each checkbox can have a subnode named sublist to indicate the sublist of that checkbox:

granite:FormNestedCheckboxListSublist
sublist

The sublist of the checkbox. The resource type would be another nestedcheckboxlist (or its derivative).

Example:

+ mynestescheckboxlist
  - sling:resourceType = "granite/ui/components/coral/foundation/form/nestedcheckboxlist"
  + items
    + level1
      - sling:resourceType = "granite/ui/components/coral/foundation/form/checkbox"
      - text = "Level 1"
      + sublist
        - sling:resourceType = "granite/ui/components/coral/foundation/form/nestedcheckboxlist"
        + items
          + level2a
            - sling:resourceType = "granite/ui/components/coral/foundation/form/checkbox"
            - text = "Level 2 A"
          + level2b
            - sling:resourceType = "granite/ui/components/coral/foundation/form/checkbox"
            - text = "Level 2 B"