Sitemap
Nibedita Nandi

Nibedita Nandi

Checkbox Checked By Default

Jul 8, 2026

The use-case I am going to document is very trivial yet we tend to forget the solution for it.

Problem Statement : When we open the component dialog, the checkbox should be checked by default and on saving the dialog checkbox value should be stored as true.

Get Nibedita Nandi’s stories in your inbox

Join Medium for free to get updates from this writer.

Resolution :

  1. First, create a dialog with a checkbox and make sure to add its sling:resourceType = granite/ui/components/coral/foundation/form/checkbox
  2. Add value property(boolean) true.
  3. Add checked property(boolean) true.
  4. Make sure to have name property against which the field value gets stored in JCR.
  5. Add a text property which appears as the label for the field in the dialog.
Press enter or click to view image in full size
Dialog properties

That’s it.

6. Checkbox gets checked by default when we open the dialog.

Press enter or click to view image in full size
Checkbox gets checked by default

7. When we save the dialog on the page, checkedCheckbox gets true value.

Press enter or click to view image in full size
true value gets saved in JCR

--

--