【问题标题】:Calling javascript function after finishing bean method完成bean方法后调用javascript函数
【发布时间】:2017-08-16 01:15:44
【问题描述】:

我想在 bean actionListener 之后执行 javascript 函数。我使用的是 JSF 1.2,richfaces 3.3。在我的情况下,我想在完成 bean 的方法后显示一个图表。我的表 tab正在填充,但 javascript 函数没有工作。这是我的尝试:

<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>

【问题讨论】:

  • @BalusC,你有什么建议吗?
  • 说“不工作”帮助不大。函数不执行吗?它是否已执行但不执行任何操作? (在那种情况下显示函数的代码)还有别的吗?

标签: javascript richfaces jsf-1.2


【解决方案1】:

我通过使用 &lt;a4j:commandButton&gt; 和 `:

解决了这个问题
<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>

【讨论】:

    猜你喜欢
    • 2017-08-16
    • 1970-01-01
    • 2010-11-08
    • 1970-01-01
    • 1970-01-01
    • 2015-12-08
    • 1970-01-01
    • 2019-07-06
    • 2019-09-26
    相关资源
    最近更新 更多