I have created a simple dropdown with two options Yes and No which return the values of "true" and "false" respectively.
<enableTool
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
class="cq-dialog-dropdown-showhide"
cq-dialog-dropdown-showhide-target=".list-option-listfrom-showhide-target"
fieldLabel="Enable tooltip?"
name="./enableTool">
<items jcr:primaryType="nt:unstructured">
<true
jcr:primaryType="nt:unstructured"
text="Yes"
value="true"/>
<false
jcr:primaryType="nt:unstructured"
text="No"
value="false"/>
</items>
</enableTool>
I want to implement the following logic in sightly
if (value of the returned string is true)
{
Do something
}
For This is wrote the following sightly code
<div data-sly-test="${properties.enableTool == 'true'}"> Value is true</div>
when I run this "Value is true" is always printed irrespective of the fact whether the the value of propeties.enableTool is true or false.
please note that if I write <div> ${properties.enableTool} </div>
, I see the values as true or false ,correctly, as per my selection.
Any idea what am I doing wrong?
Thanks in advance!