6 Replies Latest reply on Nov 11, 2008 1:30 PM by Jason Long

    rich:contextMenu inside scrollable div problem

    Jason Long Master

      When I use a scrollable div for the center of my application, rich:contextMenu will not open next to the button I attached it to. It opens in the same place at the top of the page. Which is not visible if the user has scrolled down. I have specified both attachedTo and attached=true.

      If I remove the scrollable panel it works as expected.

      Please see code samples below and suggest a workaround or mistake on my part.


      I have the following code in a column of a datatable.

      <a4j:commandButton id="releaseAvailableButton" onclick="return false;"/>
       <rich:contextMenu id="searchMenu" event="onclick" disableDefaultMenu="false" attachTo="releaseAvailableButton" submitMode="none" attached="true">


      The center panel of my application
       <a4j:outputPanel align="center" id="outerCenterPanelContent" styleClass="outerCenterPanelContent">
       <a4j:outputPanel align="center" id="centerPanelContent" layout="block">
       <ui:insert name="content"></ui:insert>
       </a4j:outputPanel>
       </a4j:outputPanel>


      with CSS

       .outerCenterPanelContent
       {
       overflow:auto;
       position:absolute;
       top:83px;
       bottom:40px;
       left:8px;
       right:8px;
       }
      


      This keeps the my menu and footer from moving when the center of the application is scrolled by the user.