How to provide custom value on checkbox in cq5 dialog?
Asked Answered
aem
E

1

0

I just created a widget inside my dialog in whose xtype=selection i.e checkbox. Is there any way through which i can get my custom value instead of true and false while select and deselecting the check box. suppose i want to get the value "Yes" when i select the checkbox. the alternative way is to handle it inside the jsp of the component but is it possible to handle it at dialog level ?

Enjoyment answered 6/2, 2015 at 9:0 Comment(1)
Haven't tried it, but my reaading of this answer implies that 'optionsValueField' might work — https://mcmap.net/q/1633527/-select-value-from-xtype-selection-type-checkbox-cq5Trotskyite
D
1

You can give this a try

{
  xtype: "selection",
  fieldLabel: "Yes/No",
  name: "./yesNo",
  hideLabel: false,
  type: "checkbox",
  allowBlank: true,
  jcr:primaryType: "cq:Widget",
  fieldDescription: "Check for Yes",
  options: {
      jcr:primaryType: "cq:WidgetCollection",
      option0: {
                value: "Yes",
                jcr:primaryType: "nt:unstructured",
                text: ""
               }
         }
}

And when reading it properties.get("yesNo","No")

Dereliction answered 6/2, 2015 at 16:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.