如何在cq5对话框的复选框中提供自定义值? [英] How to provide custom value on checkbox in cq5 dialog?

查看:73
本文介绍了如何在cq5对话框的复选框中提供自定义值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在对话框内创建了一个小部件,其xtype = selection即复选框。有什么方法可以在选择和取消选中复选框时获取我的自定义值,而不是true和false。假设我想在选择复选框时获得值是。另一种方法是在组件的jsp内部处理它,但是可以在对话框级别处理它吗?

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 ?

推荐答案

您可以尝试一下

{
  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)

这篇关于如何在cq5对话框的复选框中提供自定义值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆