In the RichFaces label, the button in the pop-up window needs to be clicked twice to work

A problem encountered in using RichFaces tag development is to click the button (a4j:commandButton) on the popup page (xhtml page wrapped with the rich:popupPanel tag) to open another popup page, and the action of the button when the button is clicked for the first time The event (<a4j:commandButton action="#{action.method()}" ...) is not executed, but only when the button is clicked a second time.

It is necessary to render the <h:form> tag in the popup page when the popup interface is opened, so that the action event of the button clicked in the popup page can be executed by clicking once.

Part of the code of the first popup page:
<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>




Main page code (opens the first popup):
<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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326315643&siteId=291194637