1 Reply Latest reply on Mar 11, 2006 7:10 AM by gavin.king

    Conversations:

    caron1

      I see that there has been quite a bit of discussion around stopping and starting conversations. I have a similiar problem in that I don't want to nest conversations but stop one conversation and begin another.

      Some further info...

      I have two views (one views a Property and another a Tenant).
      Backing each view are two Seam conversation-scoped stateful session beans.
      The Property view has a list of Tenants with hyperlinks to edit the
      Tenant details.
      The way I want it to work is that when they click on the Tenant link,
      the Property conversation should end and a new conversation begins
      for the Tenant view.

      What is the recommended way to link between two views; being able
      to end one conversation and start another?

      I have tried to implement it by calling an action on the Property session bean
      which in turn invokes a method on the Tenant session bean. I have added
      @End and @Begin to these methods but I get a error to say that there is
      already a conversation in progress.


      // method in the Property session bean
      @End
      public String viewTenant() {
       // the tenant populated using a DataModelSelection
       Locator.getInstance().getTenantManager().selectTenant(tenant);
       return "viewTenant";
      }
      



      // and in the Tenant session bean
      @Begin
      public void selectTenant(Tenant tenant) {
       this.tenant = tenant;
       initTenant();
      }
      


      Thanks
      Caron


        • 1. Re: Conversations:
          gavin.king

          I'm pretty sure that trying to do this would always be conceptually wrong. You are trying to carry state forward from one conversation to the next, so by definition, it is not a new conversation. More likely,

          (a) It is really the same conversation or
          (b) You want a nested conversation or
          (c) The state from the first conversation really belongs in the PAGE or SESSION scope, or perhaps in the EVENT scope with the selection being carried forward as a request parameter

          I'm inclined toward "it is a nested conversation"...