5 Replies Latest reply on Apr 25, 2008 2:21 PM by Pete Muir

    can't restore parent conversation without redirect

    Ale Fred Newbie

      after invoking an action method marked with @End within a nested conversation the parent one is not restored.
      Forcing the  action method to redirect even to the same page with the beforeRedirect attribute, the stuff works.
      that's the use case:


      page :


      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
           xmlns:s="http://jboss.com/products/seam/taglib"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:c="http://java.sun.com/jstl/core"
           xmlns:a4j="http://richfaces.org/a4j"
           xmlns:rich="http://richfaces.org/rich" >
           <HEAD>
           <title>test </title>
           </HEAD>
      
           <body>
                <h1>test started at : #{currentTime}</h1>
                
                     <h:form >
                          <h:outputText value=" #{currentTime} - id=#{conversation.id} - longRunning=#{conversation.longRunning} - nested=#{conversation.nested}"/>
                          
                          <br/>
                          <h:commandLink ajaxRendered="false" rendered="#{!conversation.longRunning}"  value="start long running"  action="#{convTest.startLongRunning}" >
                                    <s:conversationId/>
                          </h:commandLink>
                          <br/>
                          <h:commandLink  ajaxRendered="false" rendered="#{conversation.longRunning}"  value="end current"  action="#{convTest.endCurrent}">
                                    <s:conversationId/>
                          </h:commandLink>
                          <br/>
                          <h:commandLink   rendered="#{!conversation.nested and conversation.longRunning}"  value="start nested"  action="#{convTest.startNested}">
                                    <s:conversationId/>
                          </h:commandLink>
                     </h:form>
      
           </body>
           
      </html>



      component :



      @Name("convTest")
      public class ConvTest {
           @Logger Log log;
           
           @Begin
           public void startLongRunning(){
                log.debug("startLongRunning");
           }
           @Begin(nested=true)
           public void startNested(){
                log.debug("startNested");
           }
           @End
           public void endCurrent(){
                log.debug("endCurrent");
      
           }
           
      }



      changing the end method in the following way makes everythig work :


      @End(beforeRedirect=true)
           public String endCurrent(){
                log.debug("endCurrent");
                return "/test.xhtml";
           }



      what's wrong?


      Thanks