我有一个宏组件,DualListBox
其中还包含复选框,如下所示:
<hlayout
style="padding-left: 40px;padding-top:20px;padding-bottom:20px;"
hflex="1" vflex="1">
<separator />
<listbox id="candidateLb" vflex="true" width="250px"
multiple="true" model="${arg.candidateModel}">
<listhead>
<listheader label="Default Column List"></listheader>
</listhead>
<template name="model" var="each">
<listitem>
<listcell label="${each}" />
</listitem>
</template>
</listbox>
<vbox spacing="10px">
<image style="cursor:pointer" id="chooseAllBtn"
src="/images/rightrightarrow_g.png" />
<image style="cursor:pointer" id="chooseBtn"
src="/images/rightarrow_g.png" />
<image style="cursor:pointer" id="removeBtn"
src="/images/leftarrow_g.png" />
<image style="cursor:pointer" id="removeAllBtn"
src="/images/leftleftarrow_g.png" />
</vbox>
<listbox id="chosenLb" vflex="true" width="250px"
model="${arg.chosenDataModel}" >
<listhead>
<listheader label="Selected Column List"></listheader>
</listhead>
<template name="model" var="each">
<listitem>
<listcell label="${each.value}" >
<separator orient="vertical" />
<b > <checkbox checked="${each.checked}" /></b>
</listcell>
</listitem>
</template>
</listbox>
<vbox spacing="10px">
<image style="cursor:pointer" id="topBtn"
src="/images/upuparrow_g.png" />
<image style="cursor:pointer" id="upBtn"
src="/images/uparrow_g.png" />
<image style="cursor:pointer" id="downBtn"
src="/images/downarrow_g.png" />
<image style="cursor:pointer" id="bottomBtn"
src="/images/downdownarrow_g.png" />
</vbox>
</hlayout>
我的问题是,当有人检查 CheckBox 时,我想调用一个方法来更新一些值。我怎样才能做到这一点?