3 Replies Latest reply on Jul 17, 2009 4:57 AM by Ronald van Kuijk

    extendedDataTable contextMenu

    Hans Dampf Newbie

      how to add a rich:contextMenu to this thing?
      the contextMenu item actions should refresh the data, that means, the extendedDataTable - and not the whole page - should be reRendered.
      this should work dependent on the selected rows of the Table (multiple lines are selected).

      I tried a lot of things , always problems.
      1. attached the menu directly to the table. table_group is an a4j:outputPanel that contains the extendedDataTable.

      <rich:menuItem reRender="table_group" submitMode="Ajax" value="Delete User" actionListener="#{users.delete}"
       id="menuItem_deleteUser">

      effect: reRendering the table stalls forever (server side methods in the backing bean are finished, the circle that indicates a refresh is drawn inside the table)
      2. attached it via rich:componentControl (attached to the table)
      effect: oncontextmenu action is ignored, how to intercept a right mouse button click to make this work? Other events aren't ignored
      3. attached it outside the panel, via attachTo="table_user" (the id of the table)
      effect: the menu item action is executed, but the table selection is not updated automatically, so the server can't determine, which data row is currently selected in the Browser and which rows to change. Is there a way for the Server to get the actual selection?
      4. like 3. but update of the table selection in the backing bean on server side via a
      <a4j:support event="onselectionchange" actionListener=".."/>
      attached to the extendedDataTable
      effect: server is notified via the actionListener about selection change, but if the menu item of the context menu is clicked reRendering the table stalls forever


        • 1. Re: extendedDataTable contextMenu
          Hans Dampf Newbie

          of course the default context menu of the table is disabled.
          I tried also to add the context menu to the outputPanel.

          • 2. Re: extendedDataTable contextMenu
            Ilya Shaikovsky Master

            1) problem could be resolved by update to the latest RF version.

            • 3. Re: extendedDataTable contextMenu
              Ronald van Kuijk Master

              Ilya,

              latest is 3.31 in this case? Or latest snapshot? Since with 3.3.1 I had the same problem as Igsuperboss had and eventually did some tricks where the contextmenu was on a surrounding div. His mentioning of the update of the selection is another challenge. right-click for the context menu does not select anything, so you first have to select with a left click and then right-click. Your suggestion in another topic is not working. I'll try to experiment a little more since this is my last 'issue' in the process of writing a large blog entry on using extended datatables, dynamic tabs, using contextmenu and still keep the performance good, especially to prevent a lot of rerendering when opening a new tab.