RichFaces标签,弹窗中的按钮需要点击两次才起作用的问题

在使用RichFaces标签开发遇到一个问题,就是在弹窗页面(使用rich:popupPanel标签包裹的xhtml页面)点击按钮(a4j:commandButton)打开另一个弹窗页面,第一次点击按钮的时候按钮的action事件(<a4j:commandButton action="#{action.method()}" ...)并没有执行,第二次点击按钮时才执行。

需要在打开弹窗界面时,同时把弹窗页面里面的 <h:form>标签渲染,这样在这个弹窗页面里点击按钮的action事件,点击一次就可以执行了。

第一个弹窗页面部分代码:

<rich:popupPanel id="OpenCloseLinkBatchEditMP" width="850" height="400" resizeable="false" moveable="true">
<f:facet name="header">Open &Close Link #{i19n.translate('elm.base.ejc')}</f:facet>
<h:form id="DVFormLink">
<h:message id="errorMessage" for="errorMessages"></h:message>
<s:decorate id="errorMessagesDec">
<h:messages id="errorMessages" style="color: red;"></h:messages>
</s:decorate>

<rich:panel style="width:97%; border:0;">
<h:panelGrid columns="2" width="90%">
<s:decorate id="orgSelectDec"
template="/layout/edit.xhtml">
<ui:define name="label">#{messages['STATIC_LABEL.SUB_DEPARTMENT']}</ui:define>
<h:inputText id="SubDepartmentId" value="#{openCloseEditAction.sdeptIds}" style="display:none;">
</h:inputText>
<h:outputText id="SubDepartmentName" style="position:relative;top:-6px;"
value="#{staffingParamsTool.calOrgNames(openCloseEditAction.sdeptIds)}" />
<h:graphicImage value="/img/blank.png" width="5px" />
<a4j:commandButton
id="orgTreeLink" value="#{messages['STATIC_LABEL.ORG_SELECTOR']}"
type="image" image="/img/org.png"
action="#{subDepartmentSelectTool.setInputBoxTags('DVFormLink:orgSelectDec:SubDepartmentId','DVFormLink:orgSelectDec:SubDepartmentName','DVFormLink:PosSelectDec','openCloseEditAction.callbackFromSelectOrgs',openCloseEditAction.sdeptIds)}"
oncomplete="#{rich:component('ReduceFocusToolMultiStoreMP')}.show();"
render="reduceFocusToolFormMultiStore, selectedForm"
ajaxSingle="false" />
</s:decorate>



主页面代码(打开第一个弹窗):

<a4j:commandButton value="#{messages['STATIC_LABEL.LINK_TO']}" render="OpenCloseLinkBatchEditMP,DVFormLink" execute="@this" oncomplete="#{rich:component('OpenCloseLinkBatchEditMP')}.show();"
action="#{openCloseEditAction.batchLink2Ejc()}"
rendered="#{openCloseAction.viewDataMode == 0}">



mark.....
http://www.it1352.com/52369.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值