bean方法完成后调用javascript函数 [英] Calling javascript function after finishing bean method
本文介绍了bean方法完成后调用javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在 bean actionListener 之后执行 javascript 函数.我使用的是 JSF 1.2,richfaces 3.3.在我的情况下,我想在完成 bean 的方法后显示一个图表.我的表 tab
正在填充,但是javascript 函数不起作用.这是我的尝试:
I want to execute javascript function after bean actionListener.I am using JSF 1.2, richfaces 3.3.In my case I want to display a chart after finishing bean's method.My table tab
is filling but the javascript function didn't work. This is my attempt :
<h:form>
<h:commandButton value="Click" actionListener="#{bean.monActionListener}" reRender="tab">
<a4j:support event="onClick" oncomplete="show()" />
</h:commandButton>
<h:form>
<h:form id="sortie">
<rich:dataTable id="tab" rendered="#{not empty bean.listSortie}"
value="#{bean.listSortie}" var="raison">
<h:column headerClass="headerleftfacet">
<h:outputText value="#{raison[0]}">
</h:outputText>
</h:column>
<h:column headerClass="headermiddlefacet">
<h:outputText value="#{raison[1]}" >
</h:outputText>
</h:column>
</rich:dataTable>
推荐答案
我通过使用
和 `:
I resolved this problem by using <a4j:commandButton>
and `:
<h:form>
<h:commandButton value="Click" actionListener="#{bean.monActionListener}" reRender="tab" oncomplete="alert('ok')">
<h:form>
<a4j:outputPanel id="tab">
<h:form id="sortie">
<rich:dataTable id="tabb" rendered="#{not empty bean.listSortie}"
value="#{bean.listSortie}" var="raison">
<h:column headerClass="headerleftfacet">
<h:outputText value="#{raison[0]}">
</h:outputText>
</h:column>
<h:column headerClass="headermiddlefacet">
<h:outputText value="#{raison[1]}" >
</h:outputText>
</h:column>
</rich:dataTable>
<h:form>
</a4j:outputPanel>
这篇关于bean方法完成后调用javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文