Extjs 如何通过cq.ext.button处理程序将变量传递给javascript函数?

Extjs 如何通过cq.ext.button处理程序将变量传递给javascript函数?,extjs,aem,Extjs,Aem,我的CQdialog.xml中有以下代码 <toolbar jcr:primaryType="cq:Widget" xtype="toolbar"> <items jcr:primaryType="cq:WidgetCollection"> <input jcr:primaryType="cq:Widget" xtype="textfield" name="./myInput"> <

我的CQ
dialog.xml中有以下代码

<toolbar
jcr:primaryType="cq:Widget"
xtype="toolbar">
<items
    jcr:primaryType="cq:WidgetCollection">
    <input
        jcr:primaryType="cq:Widget"
        xtype="textfield"
        name="./myInput">
    </input>
    <button
        jcr:primaryType="cq:Widget"
        xtype="button"
        name="./myButton"
        text="Submit" handler ="function() {passMyInput()};">
    </button>
</items>
这个很好用。我的问题是如何将
/myInput
的值传递给
函数passMyInput


我尝试过
handler=“function()passMyInput('./myInput')};“
但它不起作用

按钮的处理函数接收两个参数,按钮
b
和事件对象
e

我们可以通过按钮获取容器对话框,然后使用
getField()
方法获取字段的值

修改后的hander函数为

function(b, e) {
    var dlg = b.findParentByType('dialog');
    var val = dlg.getField('./myInput').getValue();
    passMyInput(val);
}
有关更多信息,请参阅

function(b, e) {
    var dlg = b.findParentByType('dialog');
    var val = dlg.getField('./myInput').getValue();
    passMyInput(val);
}