【问题标题】:ZK framework getting value of a component on zul pageZK 框架在 zul 页面上获取组件的值
【发布时间】:2016-01-05 16:25:55
【问题描述】:

我正在尝试通过使用某种 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>

【问题讨论】:

    标签: zk zul


    【解决方案1】:

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

    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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 2012-01-05
      相关资源
      最近更新 更多