code, glasses

Really? Preselected checkbox not working, common AEM?

Why one simple preselected checkbox doesn't work in page properties?

Today I needed to add one, simple checbox in page properties and it should be preselected by default. Sounds simple, 5 min task, yea sure....

Since I'm not doing this stuff so often I needed to check granite documentation to see how to achive it. Looks simple, I found properties what I need (value, uncheckedValue, checked).

1
2
3
4
5
6
7
8
9
<showSomething
	jcr:primaryType="nt:unstructured"
	sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
	cq:showOnCreate="{Boolean}true"
	text="Please be preselected by default"
	name="./showSomething"
	checked="{Boolean}true" // tried also with string "true"
	value="{Boolean}true" // "true"
	uncheckedValue="{Boolean}false" /> //"false"

And of course it doesn't work in page properties just in component dialog...

Since I'm tired of doing some hacks or writing Javascript to get this stuff working, I just switched dialog to hideSomething so that not preselected checkbox have sense.

I don't understand how that kind of simple things doesn't work as expected OOTB.

Share your ridiculous cases which doesn't work? :D

You don't want a miss new blog post?

Sign up for the newsletter

© 2020 by devz