4 Replies Latest reply on Mar 23, 2006 5:37 PM by Gavin King

    Component Binding to conversation does not work

    Stefan Craatz Newbie

      Hi,

      we are trying to bind a faces UI component to a conversation.scope Java bean with SEAM 1.0B2 and myFaces 1.1.1/facelets.
      Whenever the form is postet SEAM complains that "no conversation is active" and throws an exception.

      <h:inputText value="#{conversation.input}" binding="#{conversation.inputComponent}" />
      


      Question: Am I doing something wrong? Is there a workaround?

      Thanks
      Stefan

      P.S.:
      After looking at the SEAM and myFaces source I believe that the problem is, that SEAM restores the current conversation in the AFTER_PHASE listener of RESTORE_VIEW,

       public void afterPhase(PhaseEvent event)
       {
       log.trace( "after phase: " + event.getPhaseId() );
      
       if ( event.getPhaseId() == RESTORE_VIEW )
       {
       restoreAnyConversationContext(event);
       }
       else if ( event.getPhaseId() == RENDER_RESPONSE )
      ....
      


      and myFaces sets the bindings before calling the AFTER_PHASE listener

      ....
       recursivelyHandleComponentReferencesAndSetValid(facesContext, viewRoot);
      
       informPhaseListenersAfter(facesContext, PhaseId.RESTORE_VIEW);
      ....
      
      


      Just moving the SEAM-code to the other Phase does not work, because the
      restoreAnyConversationContext(event); method accesses the component tree.

      When is the conversationID stored in the request-params and when attached to the UIViewRoot?