Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-14023

rich:contextMenu - on ajax re-render the destroy function doesn`t clean up properly


    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.5.4
    • Fix Version/s: 4.5.6
    • Component/s: component-menu
    • Labels:


      As mentioned in RF-11973, if the contextMenu attached to EDT gets re-rendered after AJAX request on f.i. "selectionchange" event, the listeners of the stale JavaScript ContextMenu(CM) instance (which was available just before the AJAX request) will be notified and therefore result in JS errors and prevent a new instance of CM to be properly displayed. The reason for this behavior is as follows: just before sending the AJAX request RF destructs the CM by calling "destroy" method of CM JS object which doesn`t clean up ALL registered event listeners for the destroy method considers the popup of the CM is already hidden. But in the case of AJAX event it is not the case: the popup of the CM is still displayed and the hide() on menu is never called (call to destroy() comes first and "nullifies" the popup instance!). It looks like some decent clean up in desroy() method is necessary in order to allow for dynamically rendered ContextMenu.

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  michpetrov Michal Petrov
                  pjotrovsky P√ętr Andreev
                • Votes:
                  0 Vote for this issue
                  4 Start watching this issue


                  • Created: