2017-03-23 11 views
0

これは私の最初の質問です。私のプロジェクトでは、JSF 1.2とrichfaces 3.3を使用しています。私は、Beanのメソッドの実行を終了した後、javascript関数を実行したい。 Beanのメソッドはうまく動作し、テーブルを埋めるが、javascript関数は機能しませんでした。これは私の試みです:メソッドbeanの終了後にjavascript関数を実行する(<a4j:support>)

<h:form> 
<h:commandButton value="Click" actionListener="#{bean.monActionListener}" reRender="table"> 
<a4j:support event="onClick" oncomplete="show()" /> 
</h:commandButton> 
<h:form> 

<h:form> 
<rich:dataTable id="table" rendered="#{not empty bean.listU}" 
value="#{bean.listU}" var="u"> 

<h:column headerClass="headerleftfacet"> 
<h:outputText value="#{u[0]}"> 
</h:outputText> 
</h:column> 
<h:column headerClass="headermiddlefacet">  
<h:outputText value="#{u[1]}" > 
</h:outputText> 
</h:column> 

</rich:dataTable> 

ありがとうございます!

+0

これは、[この1](http://stackoverflow.com/q/42976811/とほぼ同じ質問ですなぜ1818198)? – Makhiel

+0

@Makhiel多分私たちは同じ問題を抱えているかもしれませんが、私を助けてくれますか –

答えて

0

私は同じ問題を抱えていたと私は<a4j:commandButton><a4j:outputPanel>を使用して、それを解決:

<h:form> 
<a4j:commandButton value="Click" actionListener="#{bean.monActionListener}" reRender="tab" oncomplete="alert('ok')" /> 

<h:form> 

<a4j:outputPanel id="tab"> 
<h:form> 
<rich:dataTable id="table" rendered="#{not empty bean.listU}" 
value="#{bean.listU}" var="u"> 

<h:column headerClass="headerleftfacet"> 
<h:outputText value="#{u[0]}"> 
    </h:outputText> 
</h:column> 
<h:column headerClass="headermiddlefacet">  
<h:outputText value="#{u[1]}" > 
</h:outputText> 
    </h:column> 

    </rich:dataTable> 
    </h:form> 
    </a4j:outputPanel> 
+0

ありがとう –

関連する問題