The wrong codes are:
<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>
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.
So how can I use ajax to render two charts?