0

これが私のxhtmlコードの簡略化されたバージョンです。save2が機能している間にsave1 commandButtonが機能しない理由がわかりません。

   <rich:panel id="table_panel">
    <h:form>
    <rich:panel rendered="#{bean.showPanel}">
        <a4j:commandButton id="save1" value="Save" 
            action="#{bean.executeAction()}">
       </rich:panel>
       <rich:panel>
        <a4j:commandButton id="save2" value="Save2" 
            action="#{bean.executeAction()}">
       </rich:panel>
      </h:form>
    </rich:panel>

ボタンをクリックすると、バックエンドでshowPanelの値がtrueに更新され、*table_panel* が再レンダリングされます。その後、commandButton save1が表示されますが、表示されたとしても、クリック後にアクションexecuteAction() が呼び出されることはありません (入力しないでください)。メソッドの私のブレークポイントに)。ただし、コマンドボタンのsave2は常に正常に機能します。

これら 2 つのボタンの唯一の違いは、ラッパーの rich:panel です。一方は常に存在し、もう一方はrender="#{bean.showPanel}"属性を持っているため、何らかの UI アクションの後に表示されます。firebug で JavaScript エラーは見られませんでした。

事前に感謝します。

4

2 に答える 2

1

コマンドボタンに execute="@this" を明示的に入れてみてください。

于 2013-11-08T05:06:21.677 に答える
1

immediate="true"私の意見では、問題を絞り込む可能性があります。

<a4j:commandButton id="save1" value="Save" immediate="true"
    action="#{bean.executeAction()}">
于 2014-12-27T03:48:09.627 に答える