Skip to content

Instantly share code, notes, and snippets.

@nateyolles
Last active July 5, 2022 15:53
Show Gist options
  • Save nateyolles/ec41b7e66a9600cbaeb6 to your computer and use it in GitHub Desktop.
Save nateyolles/ec41b7e66a9600cbaeb6 to your computer and use it in GitHub Desktop.
AEM Classic UI component dialog checkboxes using the selection xtype
<!-- Checked checkbox will result in a String property of "true" -->
<myCheckbox
jcr:primaryType="cq:Widget"
fieldLabel="My Checkbox"
name="./myCheckbox"
type="checkbox"
xtype="selection"/>
<!-- Checked checkbox will result in a Boolean property of true-->
<myBooleanCheckbox
jcr:primaryType="cq:Widget"
fieldLabel="My Boolean Checkbox"
name="./myBooleanCheckbox"
checkboxBoolTypeHint="{Boolean}true"
type="checkbox"
xtype="selection"/>
<!-- Checked checkbox will result in a Boolean property of true-->
<myBooleanCheckbox
jcr:primaryType="cq:Widget"
fieldLabel="My Boolean Checkbox"
name="./myBooleanCheckbox"
type="checkbox"
xtype="selection"/>
<myBooleanCheckboxType
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name="./myBooleanCheckbox@TypeHint"
value="Boolean"
xtype="hidden"/>
<!-- Checkbox defaults to checked Boolean value of true -->
<myCheckbox
jcr:primaryType="cq:Widget"
fieldLabel="My Checkbox"
name="./myCheckbox"
value="true"
defaultValue="true"
checkboxBoolTypeHint="{Boolean}true"
type="checkbox"
xtype="selection"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment