I'm in the process of migrating our primary application from Seam 2.2 to Seam 2.3beta1, in order to get some of the benefits of JSF 2.0 and JPA 2.0. For the most part, it's going smoothly. However, some of the Ajax changes in JSF 2.0 and Richfaces 4.x are proving to be problematic in porting the code.
I have a series of components that are populated based on the contents of the others. For example, the first menu selects the item category. When a value is selected, the subcategories of that category are retrieved from the database and act as the selection items for the second menu. This entire process is Conversation scoped. Currently, the code looks like this:
requiredMessage="You must select a category"
noSelectionLabel="Select a category..."
<a:support event="onchange" reRender="subCategoryPanel"
limitToList="true" ajaxSingle="true" status="subCategoryStatus" />
This works with no problem in Seam 2.2 with JSF 1.2. However, has been removed from JSF 2.0. I've tried something like this in its place:
It fires the event as expected, but there's one large problem: it is not propagating the conversation. As a result, when the listener object is about to be called it is intercepted and the user is redirected to the defined
pages.xml. Is there any way to propagate the conversation when using
<f:ajax />? Is there a better way to accomplish this? At this point the entire migration is at a stand still, as this is a major component in the application.
I'd REALLY appreciate any help or advice.
I have. I saw that the Booking example has several ajax requests in it, but none of them are conversational, with the exception of performing validation on event="blur". I haven't seen anything that calls a method on a backend object that has @Scope(scope=CONVERSATION). The examples in Seam 2.3beta1 are pretty sparse. My guess is they haven't finished migrating all of the examples over from 2.2.
I've moved my test code to the page that starts off my conversation (the no-conversation-view-id page) to make testing a bit easier. I am clearly able to see that each call via <a:ajax /> or <f:ajax /> results in a new conversation being created, rather than propagating the existing cid in the call. The flow should be: 1) Go to the start page which results in a new conversation being created, and 2) Make the ajax calls which propagate the existing conversation. That's not the behavior I'm seeing though, which is puzzling since this works with no problem in Seam 2.2 (albeit using the <a:support /> tags instead)