2 Replies Latest reply on May 1, 2006 10:00 AM by Keith Naas

    communication from nested to parent conversation

    Keith Naas Newbie

      In http://docs.jboss.com/seam/reference/en/html/conversations.html#d0e2697 it states that:

      nested conversation has its own conversation context, and also has read-only access to the context of the outer conversation. (It can read the outer conversation's context variables, but not write to them.)


      This is convenient. However, how would you do the following:

      Component A has a field that holds a foreign key reference.
      User can search for the foreign key by clicking a button. That button kicks off a search action on Component B - I currently have it as a s:link with propagation="nest". At this point, the user is able to enter some data to help them find the foreign key they are interested in. It displays a list of foreign keys with a select button next to each. When they click one of the select buttons, I want the nested conversation to end, the selected foreign key to be propagated back to the parent conversation, and the user to be taken back to the parent screen. My thoughts were to have the following in the select action:

       @End
       public String selectForeignKey()
       {
       if ( this.foreignKeys==null )
       {
       return "findForeignKey";
       }
       setForeignKey();
       Conversation.instance().pop();
       Contexts.getConversationContext().set("foreignKey", foreignKey);
       return Conversation.instance().redirect();
       }
      


      However, as expected, this does not work. I've tried a few other varieties of the above with no success. Thoughts?


      On a side note, because the conversation is nested, Component B allows the user to kick a cancel link that causes a pop & redirect. This is incredibly simple. I was hoping that the selection logic would be just as simple.