1 Reply Latest reply on Feb 13, 2007 11:41 AM by gavin.king

    Conversation management in a framework

      Hi there,

      I am building a mini-framework using Seam to allow our developers to build search and detail pages easily. Screen page is basically search parameters + grid and the detail is just input fields with OK/Cancel. The important thing is the basis of the Search and Detail components be reusable.

      Sometimes input fields on a detail view need to be links/buttons through to another search page where an entity is selected and a relationship is established (many-to-one).

      I'm trying to figure out how to do the conversation handling and state management/passing between the pages/components. I have this page flow the user will follow.


      Entity A Search -> Entity A Detail -> Entity B Search -> Back to Entity A Detail (after selection) -> Back to Entity A Search (after OK/Cancel)


      And I need to pass to the selection from the Entity B Search back to the Entity A detail for population of one of the input fields.


      So far I have thought of the following.

      Entity A Search component has a conversation for storing the search state (pagination, current selection etc). This conversation should never be propogated to other views (maybe this should be page scope but I use s:link which precludes this I think).

      On selecting to Edit an entity redirect to the detail view (propogation=none).

      Entity A Detail component starts a new conversation.

      On selecting the button to the Entity B search redirect and propogate the conversation to the search view.

      Entity B Search starts a nested conversation. User selects.


      Now I'm not sure how to pass the selected row(s) back from search B to detail A. Maybe just have a conversational component that the detail A creates and B writes it's selection to? Then when the nested conversation is popped the selected values will still be held in the parent conversation. I plan on using "Conversation.endAndRedirect()" to get back to detail A from search B.

      An additional problem is how to resume the search A conversation when detail A is done. Should I just pass the conversation id as a parameter and have detail A switch to it when it completes?

      Many thanks if you even read this far!

      Any suggestions/critiquing welcome.