1 Reply Latest reply on Jun 21, 2011 4:57 AM by lightguard

    Conversation in ViewScoped bean

    freebit

      Hello,


      I'd like to implement a rich-client ajax only based JSF 2 application that should contain a wizard component (using Primefaces 3) and some other minor stuff.


      My current implementation uses a Seam 3 Faces @ViewScoped wizard backing bean which gets a @ConversationScoped bean injected into itself.
      The wizard backing bean thus injects a Conversation object in order to be able to call conversation.begin() and conversation.end().


      The conversation begins when the wizard dialog opens up and ends on dialog close event. During wizard step changes there are some updates to the conversation scoped bean that's part of the wizard backing bean.


      Now my problem: the conversation leaves transient state just after calling begin (correct so far) on first XHR request - any requests occuring after this initial request will show the conversation as being transient thus I'm not able to end it manually. (all updates to the conversation scoped bean are lost after the first XHR call)


      Can someone explain this to me?


      Greetings


      - Marcel

        • 1. Re: Conversation in ViewScoped bean
          lightguard

          I haven't used the wizard component in Primefaces, does it stay on the same view? If it does you should be just fine with @ViewScoped (may have to use the FlushManager in Seam Persistence to switch the flush mode though, and possibly change the EntityManager producer if you don't want to start / end a conversation).


          If you want to keep the conversation scope, make sure any XHR calls are sending the conversation id, if they are not you'll have to add that. If they are, you may be seeing a bug.