3 Replies Latest reply on Sep 28, 2007 2:33 PM by maxmustang

    On Tree Seletion go to other Page

    maxmustang

      Hello all,

      I tried out the Default Tree Model in the examples http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf

      There ist being used a tree Paramter "nodeSelectListener"
      which gets information which element has been klicked. Iside the Listener-Method i get the selected Node thats fine, but then I want return "success", so that a page with Data of the selected Node is being showed. This not seems to work. I'm Beginner and thougt Listeners may also return the next page, but here this seems not to work at me. Any Ideas how to achief this?

      ---------------

      I then tried out with usage of <rich:treeNode> and inside a commandlink, i could pass a paramterer, think this shoud work.
      But for this i need an example of the Java Code (not the jsf Pages as in the examples ).

      If anyone here has a example including java Code for me of a tree to select and go to another page, this would help me very much.

      Many Greetings Max

        • 1. Re: On Tree Seletion go to other Page
          maksimkaszynski

          Max,
          listeners never worked that way. They never perform navigation, nor do they return anything.
          If you need to perform some navigation, then I see two ways.
          First - simple. Put h:commandLinks inside treeNodes, and assign action to them. Because they'll be simple commandLinks, you can return the desired outcome and navigate wherever you want.
          Second - a bit more difficult. In nodeSelectionListener method, use

          FacesContext context = FacesContext.getCurrentInstance();
          Application application = context.getApplication();
          NavigationHandler navHandler = application.getNavigationHandler();
          navHandler.handleNavigation(context, null, outcome);
          context.renderResponse();
          


          • 2. Re: On Tree Seletion go to other Page
            maksimkaszynski

            However, I recommend you second approach as it's more straightforward.

            • 3. Thank you - Re: On Tree Seletion go to other Page
              maxmustang

              maksimkaszynski,

              Thank you very much for your help. I will just try it - thanks again !

              Max