8 Replies Latest reply on Jan 21, 2013 12:23 PM by David BATTEUX

    [RF 4.1.M1] rich:popupPanel with form inside problem (twice click)

    Adrien Adrien Apprentice

      Hi,

      I've passe 1 week to do something with popupPanel, and I can't do it work as I expect.

       

      Context: I want to use a  rich:popupPanel in my pages. I want to open it from many h:form, so I put the popup outside any form.

       

      When I put form around the popup and set domElementAttachment="form" that's work fine:

      {code:xml}

      <h:form>    

          ........

           <a4j:commandLink action="#{ctrlSearchPopup.load}" execute="@this" value=" #{u.name} " render="popupFormAround" oncomplete="#{rich:component('popupFormAround')}.show()">

                <a4j:param name="uid1" value="#{u.name}" assignTo="#{ctrlSearchPopup.userId}" />

           </a4j:commandLink>

         ......

      </h:form>

       

       

       

      <h:form>

                <rich:popupPanel domElementAttachment="form" id="popupFormAround"               autosized="true">

                     <f:facet name="header">                    <h:outputText value="ElementAttachment=parent" />               </f:facet>

                     <f:facet name="controls">                    <h:outputLink value="#"                         onclick="#{rich:component('popupFormAround')}.hide(); return false;">X</h:outputLink>     </f:facet>       

                          <a4j:outputPanel rendered="#{not empty ctrlSearchPopup.current}"                          layout="block">

                               <h:inputText value="#{ctrlSearchPopup.current.name}" />

                               <h:inputText value="#{ctrlSearchPopup.current.txt}" />

                               <a4j:commandButton value="save" action="#{ctrlSearchPopup.save}" />

       

                          </a4j:outputPanel>             

              </rich:popupPanel>

      </h:form>

      {code:xml}

       

       

      Problem

      ------------

      My problem is that I want to put many forms in the popup to edit more object (with tabpane in client mode).

      Actually I don't understand if i do something wrong or other. I've tested with domElementAttachment=parent/form of without domElementAttachment and it s don't work.

      In the example below when the popup is edited I need to click twice to call the save method!

       

      {code:xml}

       

      <h:form>    

          ........

           <a4j:commandLink action="#{ctrlSearchPopup.load}" execute="@this" value=" #{u.name} " render="popupFormInside" oncomplete="#{rich:component('popupFormInside')}.show()">

                <a4j:param name="uid1" value="#{u.name}" assignTo="#{ctrlSearchPopup.userId}" />

           </a4j:commandLink>

         ......

      </h:form>

       

       

       

           <rich:popupPanel  id="popupFormInside"               autosized="true">

                     <f:facet name="header">                    <h:outputText value="ElementAttachment=parent" />               </f:facet>

                     <f:facet name="controls">                    <h:outputLink value="#"                         onclick="#{rich:component('popupFormInside')}.hide(); return false;">X</h:outputLink>     </f:facet>       

                          <a4j:outputPanel rendered="#{not empty ctrlSearchPopup.current}"                          layout="block">

                          <h:form>

                               <h:inputText value="#{ctrlSearchPopup.current.name}" />

                               <h:inputText value="#{ctrlSearchPopup.current.txt}" />

                               <a4j:commandButton value="save" action="#{ctrlSearchPopup.save}" />

                          </h:form>

                          </a4j:outputPanel>             

                </rich:popupPanel>

      {code:xml}

       

       

       

       

      If someone can tell me if I do something wrong or if it 's not possible to put the form inside a popup?

      In attachment I've put an example of the problem.

       

      Thanks for your help.