Skip to main content
Level 2
Jan 3, 2020 7:54 PM UTC
Solved

Coral-checkbox default checked option

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.

arunpatidar
arunpatidarAccepted solution
Community Advisor
Jan 5, 2020 2:46 AM UTC

Hi,

Just use the below value to mark the checkbox prechecked.

checked(Boolean)=true

Arun Patidar

17 replies

Adobe Employee
Jan 3, 2020 8:37 PM UTC

I think it is boolean, not booleanel. 

Have you tried:

uncheckedValue="{Boolean}false"

defaultChecked="{Boolean}true" 

Cheers,

Vishu

 

Translate
Level 2
Jan 4, 2020 2:12 PM UTC

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

Translate
arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
Jan 5, 2020 2:46 AM UTC

Hi,

Just use the below value to mark the checkbox prechecked.

checked(Boolean)=true

Translate
Arun Patidar
Level 2
Jan 5, 2020 1:43 PM UTC
It worked for "granite/ui/components/foundation/form/checkbox" but not with "granite/ui/components/coral/foundation/form/checkbox"
Translate