ZK 框架在 zul 页面上获取组件的价值

ZK framework getting value of a component on zul page

我正在尝试使用某种 getValue 方法获取 zul 页面上文本框的值。我应该在 zul 页面上处理这个,而不是在控制器上。我需要分配一个列表框单元格(这是下面列表框的第一个单元格),其值来自文本框。

    <listcell>
        <label value="" />
    </listcell>

    <listcell>
        <toolbarbutton visible="true"
            image="/resources/images/icons/1616/page_text.gif" />
    </listcell>

    <listcell>
        <label value="@{file.name}" />
    </listcell>

    <listcell>                           
        <toolbarbutton forward="onClick=onRemoveMultipleFiles"
            visible="true" id="newFileAndCommentRemove" image="/resources/images/icons/1616/delete.png" />
    </listcell>
</listitem>

如果你想要的是在文本框被填充后,第一个单元格将填充它的值,你可以这样做:

  1. 将 id 放入单元格中的标签中
  2. 在文本框中放置一个 onChange 操作,这样当文本框发生变化时,您可以将其值放入单元格

像这样:

<textbox id="textbox" onChange="label.setValue(self.getValue())"/>
<listbox id="newFileAndComment">
<listhead>
    <listheader label="1" width="30px" />
</listhead> 
<listitem self="@{each=file}">
    <listcell>
        <label id="label"/>
    </listcell>
</listitem>