5

我在一个应用程序中使用 jsf 到达面。我正在使用 rich:modalPanel 弹出阅读一些详细信息并在服务器响应后使用 a4j 命令按钮提交 tha 面板我想隐藏 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 回答