如何在JSF中隐藏rich:modalPanel的Ajax响应

如何在JSF中隐藏rich:modalPanel的Ajax响应,jsf,richfaces,Jsf,Richfaces,我在一个应用程序中使用jsf reach faces。我使用rich:modalPanel弹出阅读一些细节,并在服务器响应后使用a4j命令按钮提交tha面板。我想隐藏modalPanel,但不知道如何 我仍在努力寻找解决方案,请帮忙 rich modalPanel的代码是这样的 <rich:modalPanel id="panelID" minHeight="200" minWidth="450" height="200" width="500"> <a4j:commandB

我在一个应用程序中使用jsf reach faces。我使用rich:modalPanel弹出阅读一些细节,并在服务器响应后使用a4j命令按钮提交tha面板。我想隐藏modalPanel,但不知道如何

我仍在努力寻找解决方案,请帮忙

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

很简单,您可以编写:

**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\u form
”-是显示
的表单的Id。

是否可以从普通javascript文件将其关闭?(我想通过一个
onmaskclick
来进行不同的思考,但最后应该关闭它