I have a classic UI dialog. This has a drop down in dialog which has "true"/"false" as options
<mydropdown
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldLabel="My Dropdown"
name="./dropdownValue"
type="select"
xtype="selection">
<options jcr:primaryType="cq:WidgetCollection">
<test
jcr:primaryType="cq:Widget"
text="True"
value="true"/>
<test_x0020_1
jcr:primaryType="cq:Widget"
text="False"
value="false"/>
<test_x0020_2
jcr:primaryType="cq:Widget"
text="someothervaluetext"
value="someothervalue"
</options>
</mydropdown>
The JCR structure is saving value as String "true", "false". When user edits the dialog, the value should be populated back in the field. "true", "false" value is not getting populated, while "someothervalue" works fine.
Checked the Selection.js in libs, code below is responsible to populating data in dialog
var count = this.comboBox.store.getTotalCount();
var i = 0;
for (; i < count; i++) {
var data = this.comboBox.store.getAt(i).data;
if (data.value == this.value) { // Here data.value is coming as boolean
this.hiddenField.setValue(data.value);
this.comboBox.setValue(data.text);
break;
}
}
data.value is coming as boolean though in JCR the value is stored as string. Due to this the condition is evaluating to false and value is not set.