简体   繁体   English

如何正确更新(渲染) <h:selectManyListbox…/> ?

[英]How to properly update (render) <h:selectManyListbox…/>?

What is wrong whit this code? 这段代码有什么问题? I can not update the idOfForm (selectManyListbox )? 我无法更新idOfForm(selectManyListbox)?

<h:form id="idOfForm">    
    <h:selectManyListbox id="userListId" size="10" value="#{userBean.selectedAvailableUsers}">
                                                    <f:selectItems 
                                                        value="#{userBean.availableUsers}" /> 
                                                    <f:converter converterId="userConverter" /> 
                                                </h:selectManyListbox> 
    </h:form>



        <h:commandLink value="#{userBean.id}"
                                    action="#{userBean.update()}">
                                    <f:setPropertyActionListener
                                        target="#{userBean.selectedUser}" value="#{userBean}" />
                                        <f:ajax execute="@form" render=":idOfForm" />
                                </h:commandLink>

you can execute an update from your managedBean like this 您可以像这样从ManagedBean执行更新

RequestContext.getCurrentInstance().update("form1");

also read this question Render multiple components with f:ajax it's look like a similar question. 也阅读了这个问题使用f:ajax渲染多个组件,这看起来像是一个类似的问题。

Try it 试试吧

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 f:ajax无法呈现h:selectManyListbox - f:ajax not rendering h:selectManyListbox 我如何在将Collection绑定到h:selectOneMenu和h:selectManyListbox的复合组件中添加f:ajax支持? - How can I add f:ajax support to my composite component that binds a Collection to an h:selectOneMenu and h:selectManyListbox? 用10.000项更新h:selectManyListbox时,Ajax渲染“冻结”一段时间 - Ajax rendering “freezes” for a while when updating h:selectManyListbox with 10.000 items f:ui中的ajax:重复渲染h:outputText但无法渲染/更新h:inputText - f:ajax in ui:repeat renders h:outputText but fails to render/update h:inputText 使用AJAX和“更新面板”和“选项卡”时强制IE正确渲染 - Force IE to render properly when using AJAX and Update Panel and tabs 如何使用Ajax在Rails中正确渲染集合 - How to properly render a collection in rails using Ajax 如何在JavaScript中正确更新小计? - How to properly update subtotal in JavaScript? 如何基于h:selectOneRadio设置的布尔值有条件地渲染ah:panelGroup - How to conditionally render a h:panelGroup based on a boolean value set by h:selectOneRadio 如何正确地使用{%include%}标签在django中渲染模板(如局部视图)? - how to properly use {% include %} tag to render a template (like partials) in django? 如何在Rails上启用Turbolink的情况下通过AJAX正确渲染部分图像? - How to properly render a partial via AJAX with Turbolinks enabled on Rails?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM