2 Replies Latest reply on Jan 24, 2008 2:45 PM by tulip

    Seam with RichFaces

    tulip

      I have a very basic question.

      We have a bunch of session and entity beans. On the presentation tier, we need to use RichFaces component such as tree etc.
      Now the session bean methods returns a list of entity objects. For the front end, I need to take this list and construct a richFaces tree and hence use the richFaces classes like org.richfaces.model.TreeNode etc
      I cannot include the richfaces specific classes in the core session bean as I want to keep the presentation specfic stuff out of the core classes.

      That means I need an additional session bean which will make a call to the core session bean, get the data from the core session bean and then construct the rich faces tree. From my JSF, I will be making Seam calls to this new session bean instead of the core session bean.

      Is this the correct approach ? Please advice.

      Also how can a session bean to session bean call be made within Seam.

      Thanks

        • 1. Re: Seam with RichFaces
          damianharvey

          There's nothing wrong with that approach.

          To call another bean from inside a bean you can either:
          a) inject the bean using @In; or
          b) create it inline using Component.getInstance("mybean")

          Cheers,

          Damian

          • 2. Re: Seam with RichFaces
            tulip

            Thanks for the reply.
            Question. How do I instantiate the new session bean from within the old session bean ?

            thanks