4 Replies Latest reply on Jun 9, 2007 9:36 AM by gagool

    separate state for two identical forms and sfsb

    fredf

      I have two, functionally identical forms on a jsf page on which the user can execute an action in a seam stateful session bean. I want to keep separate state for each form. How can I do this when the forms call the same action on the same seam component? How will they be identified as two separate forms but using the same component for its own state?

      thanks

        • 1. Re: separate state for two identical forms and sfsb
          christian.bauer

          You use two conversations. Component classes and form pages are "templates", state is related to "instances" of these. You can have two instances of each in separate conversation contexts.

          • 2. Re: separate state for two identical forms and sfsb
            gagool

            I'm not sure I understand how to do this corerectly

            If I create a form with seam gen and include it twice on a page with ui:include, each form gets a different conversation id but they both reference the same backing bean instance.

            I have tried some other things as well but it did not suceed.

            • 3. Re: separate state for two identical forms and sfsb
              pmuir

              I'm not quite sure what Christian is meaning, as you can't have more than one currently active conversation (i.e. more than one associated with a page, ignoring nested conversations).

              You need two backing entities, one for each form (use @Role, and pass in the name of the entity to use a parameter to ui:include). Both can call the same action fine.

              • 4. Re: separate state for two identical forms and sfsb
                gagool

                I did suspect this :(

                What we need to do is to make user composable pages (like netvibes, but other users should be able to visit your "portal" too).
                The problem then becomes that there can be X amounts of any form/subview and that they need to be seprated somehow.

                We have been trying to adapt jboss portal to do this for us but that didnt work out since our cells on the page would want to interact with eachother and we would like a seam session context shared amongst the portlets+ some other things.

                Does anyone have a hint how to do this or if there is a suitable library for that works with seam/facelets.