2 Replies Latest reply on Apr 17, 2007 5:58 PM by quilleashm

    Conversation context flush required before redirect?

      Hi all,

      I have some code like this (pseduo)

      MyConversationComponent comp = MyConversationComponent.instance()
      comp.setValue( xxx )
      
      Redirect redirect = Redirect.instance()
      redirect.setViewId( xxx )
      redirect.setConvProp( true )
      redirect.execute()
      


      Now after the redirect I try and access the MyConversationComponent in a detail component and it wasn't there. I found that unless I called Contexts.getConversationContext().flush() the component would not get copied into the backing session and so would not be available after the redirect. The conversation was being propogated properly as I could see other components in the conversation context from before the redirect.

      Is this intended behaviour? Could redirect.execute() flush the conversation context?

      I noticed that DebugPageHandler does the same thing.

      Cheers.

      Mike.


        • 1. Re: Conversation context flush required before redirect?

          How are you getting your component instance? If it's via Bijection

          @In @Out MyConversationComponent component;

          Then I would expect that your changes to component should get propagated even if you make a call to Redirect.execute() with the method. If it's not I'd file a JIRA.

          If however you're manually grabbing a component out of a context I wouldn't expect bijection demarcated flushing to happen for you, and thus this would be expected behavior. It's hard to tell from your pseudo code what you're actually doing.

          • 2. Re: Conversation context flush required before redirect?

            Thanks for the reply.

            I solved my problem/mystery (predicatably my fault). The code in question is being called from outside the phase listeners, in a custom Lifecycle implementation to be precise so the Seam Lifecycle.endRequest() never gets called to flush out the conversation context. Just have to do it manually in this instance.

            Cheers.

            Mike.