渲染和f多个组件:AJAX [英] Render multiple components with f:ajax

查看:112
本文介绍了渲染和f多个组件:AJAX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误的codeS是:

<h:form id="search_form">
<h:commandButton class="button" value="View" action="#{InfoBean.search}">
    <f:ajax execute="search_form" render="linear1"></f:ajax>
    <f:ajax execute="search_form" render="linear2"></f:ajax>
</h:commandButton>
<p:lineChart id="linear1" value="#{InfoBean.linearModel1}" legendPosition="e"/>
<p:lineChart id="linear2" value="#{InfoBean.linearModel2}" legendPosition="e"/>
</h:form>

当我点击的commandButton我想要做的就是,我要刷新这两个图表。但现在我用了两个&LT; AJAX&GT; 标签,它的第二个不工作

What I want to do is when I click on the commandButton, I want to refresh those two charts. But now I used two <ajax> tags, of which the second doesn't work.

那么,如何可以使用Ajax呈现两个图表?

So how can I use ajax to render two charts?

推荐答案

您可以渲染多个组件单个 F:AJAX 。在您的样本,将是这样的:

You can render multiple components with single f:ajax. In your sample it would be something like:

<f:ajax execute="search_form" render="linear1 linear2"/>

这篇关于渲染和f多个组件:AJAX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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