1 Reply Latest reply on Apr 5, 2008 5:41 PM by Pete Muir

    How to return from nested conversation?

    Tomas Cerny Novice

      Hi I thought that ending the nested conversation will redirect me to the parent conversation?

      But what is happening is that the outer conversation is ended and inner (parent one) is not restored.


      I am using natural conversations. And what I will end up with exception


      18:08:06,610 ERROR [SeamPhaseListener] uncaught exception
      java.lang.IllegalStateException: Conversation id is already in use: contestHome:2
              at org.jboss.seam.core.Manager.updateCurrentConversationId(Manager.java:92)
      



      where contestHome:2 is my parent conversation.



      I am solving that this way with this java code


      public String cancel() {
              // http://jira.jboss.org/jira/browse/JBSEAM-2606
              if (Manager.instance().isNestedConversation()) {
                  // pop
                  String parent = Manager.instance().getParentConversationId();
                  // kill current
                  Manager.instance().endConversation(true);
                  // retrieve parent enrty 
                  ConversationEntry ce = ConversationEntries.getInstance()
                          .getConversationEntry(parent);
                  if (ce != null) {
                      // go for it
                      ce.redirect();
                      return Navigation.END_NESTED;
                  } else {
                      getFacesMessages().add("Parent conversation does not exist");
                      return Navigation.CANCEL;
                  }
              } else {
         
                  return Navigation.CANCEL;
              }
      
          }



      But I would be much happier to have proper solution to that.


      Does anyone made it work?


      Thanks Tomas