如何更新< ui:repeat>没有页面重新加载的数据? [英] How to update <ui:repeat> data without page reload?

查看:114
本文介绍了如何更新< ui:repeat>没有页面重新加载的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户名列表,并且用户名列表会根据用户给定的输入数量而增加.事实是,当用户输入用户名时,列表中会填充输入内容,而我只会被更新当我的页面重新加载时.这是到目前为止我尝试过的代码.

I have a list of user names and the list of user name increases based on the number of inputs given by the user.The thing is as the user inpputs the user name the list gets populated with the inputs and my gets updated only when my page reloads. Here is the code that i have tried so far.

 <ui:repeat id="update" value="#{data.value}" var="tes">

 #{tes.name}
 </ui:repeat>

 <h:inputText value=#{data.name}/>
 <p:commandButton actionListener="#{data.addname()}" update="update"/>

我无法通过重新加载页面来更新我的数据,请建议我如何通过重新加载页面来更新ui:repeat数据.预先感谢.

I am unable to update my data with out page reload please suggest me how to update ui:repeat data with out page reload. Thanks in advance.

推荐答案

尝试一下:

<h:form>
    <h:panelGroup id="toUpdate">
        <ui:repeat value="#{data.value}" var="tes" >
            #{tes.name}
        </ui:repeat>
    </h:panelGroup>

    <h:inputText value=#{data.name}/>
    <p:commandButton actionListener="#{data.addname()}" update="toUpdate"/>
</h:form>

这篇关于如何更新&lt; ui:repeat&gt;没有页面重新加载的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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