需要在打开弹窗界面时,同时把弹窗页面里面的 <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