Skip to content

Instantly share code, notes, and snippets.

@nateyolles
Last active November 17, 2015 17:46
Show Gist options
  • Save nateyolles/9a7ea78d584318faa2aa to your computer and use it in GitHub Desktop.
Save nateyolles/9a7ea78d584318faa2aa to your computer and use it in GitHub Desktop.
Get a checkbox value in an AEM/Sling Sightly Java bean
/*
* Sightly classes extending com.adobe.cq.sightly.WCMUse or com.adobe.cq.sightly.WCMUsePojo
*/
Boolean checkbox = getProperties().get("myBooleanCheckbox", Boolean.class);
/*
* Set the default value.
*/
Boolean checkbox = getProperties().get("myBooleanCheckbox", false);
Boolean checkbox = getProperties().get("myBooleanCheckbox", true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment