我刚在对话框中创建了一个小部件,其中xtype =选择,即复选框。在选择和取消选中复选框时,有什么方法可以获取我的自定义值而不是true和false。假设当我选中复选框时,我想获得值“是”。另一种方法是在组件的jsp中处理它,但是可以在对话级别处理它吗?
答案 0 :(得分:1)
你可以尝试一下
{
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: ""
}
}
}
阅读时properties.get("yesNo","No")