1 Reply Latest reply on Oct 11, 2011 3:26 AM by Ellie Fabrero

    How to properly reRender a rich:tree after a drop event?

    Ellie Fabrero Newbie

      Hi everyone,

       

      This is related to my previous questions on how to reRender a rich:tree after a drop event.

      Actually i have come up a workaround using a4j:support oncomplete event.

      What happens was after the response is complete it then reRenders my rich:tree which is what i want.

       

      The problem is:

       

      I have a functionality of rename folder on my tree node that opens rich:inplaceInput and rename the folder.

      When a dobol click event happens it fires an ajax request and since a have a4j:support that will reRender my whole tree when the request is complete the whole tree is refreshed even though i'm not finished renaming my folder.

      Therefore my work around on drag and drop happens to confilct the implementation on rich:inplaceInput on renaming folder.

       

      I tried different events like ondragend or ondropend to reRender my tree on a4j:support but out of luck.

       

      The questions are:

       

      Is there any or best implementation for proper reRendering a rich:tree after a drop event?

      Can i force to reRender my component using java code inside my drop event method on my backing bean?

       

      Thanks for those who will help.

       

        • 1. Re: How to properly reRender a rich:tree after a drop event?
          Ellie Fabrero Newbie

          Problem solved.

           

          On my drop event listener method we can get the the source component where the event happens in my case the rich:treeNode then

          we i cast it to UITreeNode. Since i want to reRender the whole tree i can get UITree in the instance of UITreeNode method getUITree.

           

          What i did was get the current AjaxContext instance then add the tree to be reRendered using the method

          addComponentToAjaxRender(UIComponent ui) then i pass the UITree instance. And then it will reRender the whole tree after the response

          is sent. Thats all.

           

          -cheers

           

          1 of 1 people found this helpful