2 Replies Latest reply on Feb 2, 2008 9:17 AM by pmuir

    Join natural conversation ? how ??

    enda

      Hey I do not think that it is possible to merge your named conversation as you have in documentation in general example?

       <h:commandLink
       action="#{teamManager.select(team)}" value="select">
       <s:conversationName value="teamHome"/>
       </h:commandLink>
      


       <conversation name="teamHome"
       parameter-name="teamName"
       parameter-value="team-#{team.id}"/>
      


      As I understand from your documentation I have to use <s:conversationName value="teamHome"/> in my link to merge conversations, but I make my conversation name by team.id that is what the best choice is ;D. But how can they join them when team is going to be selected and and I am already asking for its id, even though that it is not selected yet!

      ex.

      existing Conv1 -> team.id=1
      new Conv2 -> team.id=null ; select(team) ; team.id=1 => crash
      it takes value from team.id=null

      Did I miss something in documentation?


        • 1. Re: Join natural conversation ? how ??
          enda

          My working solution that is such a hack but now I see the power we have ;D

          Please comment it or provide better solution

          public String select(Team team) {
           conversationId = team.getId().toString();
           ConversationEntries.getInstance().updateConversationId(Conversation.instance().getId(),
           conversationId);
           Set<String> existingIds = ConversationEntries.getInstance().getConversationIds();
           for (String existingConversationId : existingIds) {
           String[] split = existingConversationId.split(":");
          
           if(split.length == 2 && conversationId.equals(split[1])) {
          
           getFacesMessages().add("Conversation already exists");
           ConversationEntries.getInstance().getConversationEntry(existingConversationId).
           redirect();
           return null;
          
           }
           }
          
           return super.select(team);
           }
          
          
          


          • 2. Re: Join natural conversation ? how ??
            pmuir

            Did you look at the seambay example? This has an example of natural conversations.