5

1つのアプリケーションでjsfリーチフェイスを使用しています。サーバーからの応答後に、ポップアップで詳細を読み取り、a4jコマンドボタンを使用してパネルを送信するためにrich:modalPanelを使用しています。modalPanelを非表示にしたいのですが、方法がわかりません。

私はまだ解決策を模索しています、助けてください

リッチモーダルパネルのコードはこんな感じです。

<rich:modalPanel  id="panelID" minHeight="200" minWidth="450" height="200" width="500">
<a4j:commandButton reRender="sampleID" action="#{SomeTestAction}" image="sample-button.gif"/> 
</rich:modalPanel>
4

1 に答える 1

5

それは簡単です、あなたは書くことができます:

**UPDATED** 

javaScriptは必要ないため、このソリューションの方が優れています。

<a4j:commandButton reRender="sampleID" action="#{SomeTestAction}" image="sample-button.gif">
      <rich:componentControl for="panelId" operation="hide" event="onclick" />
 </a4j:commandButton>

またはjavaScriptを使用

<a4j:commandButton reRender="sampleID" action="#{SomeTestAction}" image="sample-button.gif" oncomplete="javascript:Richfaces.hideModalPanel('panelId');"/>

または、フォームを送信すると、ポップアップが消えます。

<a4j:commandButton reRender="sampleID" action="#{SomeTestAction}" image="sample-button.gif" oncomplete="document.getElementById('Id_form').submit();"/>:

ここで、「Id_form」-は、表示されたフォームのIDです<rich:modalPanel>

于 2009-07-05T10:41:22.880 に答える