加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 02:52:05 所属栏目:百科 来源:网络整理
导读:我在一个应用程序中使用jsf到达面.我正在使用rich:modalPanel弹出阅读一些细节,并在服务器响应后使用a4j命令按钮提交tha面板我想隐藏modalPanel但不知道如何, 我仍然在尝试解决方案,请帮忙 富modalPanel的代码是这样的. rich:modalPanel id="panelID" minHe
我在一个应用程序中使用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>

解决方法

这很简单,你可以写:

**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>显示.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读