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

    Opening popupPanel from menuItem closes straight away.

    bastian.ulke

      Hi,

       

      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>

          <f:facet name="controls">

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

          </f:facet>

          <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>

      </rich:popupPanel>{code}

      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" />

      </h:commandLink>{code}

       

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

      {code:xml}

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

          <!-- ... -->

          <rich:toolbarGroup>

              <!-- ... -->

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

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

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

              </rich:menuItem>

              <!-- ... -->

          </rich:toolbarGroup>

      </rich:toolbar>

      {code}

       

      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!

       

      Bastian