4 Replies Latest reply on Sep 15, 2011 5:11 AM by bastian.ulke

    Opening popupPanel from menuItem closes straight away.

    bastian.ulke Newbie



      i am trying to call a popupPanel from a toolbar using the following code from the demo pages:

      {code:xml}<rich:popupPanel id="popup" modal="true" resizeable="true" onmaskclick="#{rich:component('popup')}.hide()">

          <f:facet name="header">

              <h:outputText value="Simple popup panel" />


          <f:facet name="controls">

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


          <p>You can also check and trigger events if the use clicks outside of the panel.</p>

          <p>In this example clicking outside closes the panel.</p>


      Calling it from a simple commandLink using the following code works well.

      {code:xml}<h:commandLink value="Show">

          <h:outputText value="Delete Company"   />

          <rich:componentControl event="click" target="mainForm:popup" operation="show" />



      But instead calling it from there, I would like to let the popup be displayed on clicking a a menu item:


      <rich:toolbar height="26" itemSeparator="grid" id="toolbar">

          <!-- ... -->


              <!-- ... -->

              <rich:menuItem immediate="true" render="list2">

                  <h:outputText value="Display Popup"   />

                  <rich:componentControl event="click" target="mainForm:popup" operation="show" />


              <!-- ... -->





      The problem, occuring is that on clicking the menu item in a browser, the popup is shortly displayed but closes straight away without any further user interaction. If I replace the rich:menuItem with a simple h:outputLink, it also works well.


      Is there a way to make it work with a rich:menuItem as well?


      Thanks for assistance!