2 Replies Latest reply on Oct 26, 2011 2:10 PM by Rene Gritsch

    Open Modalpanel from another modalpanel (domElementAttachment)

    Rene Gritsch Newbie

      Hello,

       

      for a few days I have a problem with our modalpanels. Sometimes if I open a modalpanel inside from another modalpanel it opens

      in the background. The focus is still on the old modalpanel (which should also stay open), if i close this one the other modalpanel is there

      and i can work with it.

       

      I am using domElementAttachment=parent on the 2nd modalpanel and without its working ! To be honest, I can´t remember why I have

      added this 1 year ago, maybe because of autosuggestion problem but I am not sure anymore.

       

      To give you an example is quite difficult, so before that I would like to check out the easy stuff first.

      How does Richfaces handles the "z-layer" of these panels ?

       

      Example: Modalpanel "Gruppe" with the "+" it should open the "Partnerdrehscheibe" Modalpanel which opens behind the "Gruppe"

       

      Snapshot1.bmp

        • 1. Re: Open Modalpanel from another modalpanel (domElementAttachment)
          Christian Peter Expert

          I can reproduce this behaviour:

           

          <h:form>

          <a4j:commandButton value="open mp1" onclick="#{rich:component('mp1')}.show();"/>

          </h:form>

           

          <rich:modalPanel id="mp1">

              <f:facet name="header">mp1</f:facet>

              <h:form id="mp1form">

                  mp1

                  <a4j:commandButton value="show mp2" onclick="#{rich:component('mp2')}.show();"/>

                  <a4j:commandButton value="close" onclick="#{rich:component('mp1')}.hide();"/>

              </h:form>

          </rich:modalPanel>

           

          <rich:modalPanel id="mp2" domElementAttachment="body">

              <f:facet name="header">mp2</f:facet>

              <h:form id="mp2form">

                  mp2

                  <a4j:commandButton value="close" onclick="#{rich:component('mp2')}.hide();"/>

              </h:form>

          </rich:modalPanel>

           

           

          if you change the second modalpanel parameters to: domElementAttachment="parent" then this panel would open in the background.

           

          Do you really need your modal panel(s) to be attached to their parents?

          • 2. Re: Open Modalpanel from another modalpanel (domElementAttachment)
            Rene Gritsch Newbie

            To be honest I am not sure, I´ve removed them for now. The problem is, that we have hundrets of subdialogs which open in a modalpanel (we have our own gui framework around richfaces 3.3.3) and I can darkly remember we had problems with <a4j:outputpanels ajaxrendered="true"> and autosuggestions inside the modalpanels and these helped, but I am not sure.


            I will check this tomorrow in the office and will let you know, removing domElementAttachment helped for now.


            Thank you,
            René