[jboss-user] [JBoss Seam] - Re: how to leave a long running conversation and start a new

ajay.gupta do-not-reply at jboss.com
Fri Feb 15 21:22:10 EST 2008


Folks,

We faced a similar situation a few days ago. The user could click on a hyperlink in a page to go to a different page which was required to open in a new non-nested conversation.  Before redirecting to the new page, the application was required to process the edits the user had made on the screen, save those changes and not end the conversation (instead, leave the conversation since the user could come back to the first page by back buttoning from the 2nd page).

The solution we went with was:

1. On the JSP page, use <h:commandLink> to post the form data back to the server so that the POST will propagate conversation.

2. Process the form submit using standard JSF phases.

3. Determine which page to redirect the user to.

4. In phase V, return the navigation constant corresponding to the 2nd page.

5. In pages.xml, use:

<page view-id="/first-page.jsp">


   <rule if-outcome="shouldRedirect">
       <raise-event type="leaveConversation" />
       <redirect view=id="/secondPage.jsp">
           
           
       


6. Define an event listener for leaveConversation event. In the @Observer method for this event, do as follows:

i. Conversation.leave().
ii. Get conversation entry for the Conversation object and call unlock() on it.

This worked perfectly.  I know this is not an ideal solution.

We would like to suggest that Seam team support ability for specification of a tag like <leave-conversation> in pages.xml (similar to <begin-conversation> and <end-conversation>).  That will be the ideal solution to this problem.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129799#4129799

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129799



More information about the jboss-user mailing list