Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Coral-checkbox default checked option

Avatar

Level 2

Default checked state is not appearing for coral checkboxes

"granite/ui/components/coral/foundation/form/checkbox"

but it's working fine for granite foundation one. i.e. granite/ui/components/foundation/form/checkbox.

 

I've tried many ways (e.g. checked (string) property setting as true, defaultChecked / uncheckedValue etc.) but nothing is working. One thing noticed that, "checked" property has type  ' booleanel ' while in JCR, only boolean is available;not the expression lang type. So,is it causing any issue?

 

 

Any pointers on this will be really helpful.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Just use the below value to mark the checkbox prechecked.

checked(Boolean)=true



Arun Patidar

View solution in original post

10 Replies

Avatar

Employee

I think it is boolean, not booleanel. 

Have you tried:

uncheckedValue="{Boolean}false"

defaultChecked="{Boolean}true" 

Cheers,

Vishu

 

Avatar

Level 2

Yes. tried that one too. But didn't work out. Also, it is booleanel for coral ; same thing is boolean for non-coral foundation. link s shared above.

Thanks

Avatar

Level 7

This configuration pair woked for me in AEM 6.5. Thanks  

Avatar

Correct answer by
Community Advisor

Hi,

Just use the below value to mark the checkbox prechecked.

checked(Boolean)=true



Arun Patidar

Avatar

Level 2
It worked for "granite/ui/components/foundation/form/checkbox" but not with "granite/ui/components/coral/foundation/form/checkbox"

Avatar

Community Advisor
which version are you using? I tested this in 6.3 and 6.5 works for me.


Arun Patidar

Avatar

Level 2
I'm using 6.4 here. But wouldn't be any behavioral deviation from version perspective. but thanks !

Avatar

Community Advisor

It should work for all the versions. Anyways I checked in Vanilla 6.4 version and it is working fine.

Find properties I used -

Image - https://github.com/arunpatidar02/aem63app-repo/blob/master/forum/images/checkbox.PNG

 



Arun Patidar

Avatar

Level 1

Hi @arunpatidar This configuration works for cases when I drag and drop new instance of a component. But we have a case when the component is already authored and a new checkbox is being introduced to the dialog of existing authored component. In such cases it does not work. Can you please help on such cases ?