-
1. Re: Conversation state survives conversation end?
dan.j.allen Jun 14, 2008 4:15 AM (in response to adamw)First of all, any time you are creating a link to create a new record, you should forcefully set the id parameter to blank:
<s:link view="/PersonEdit.xhtml" value="New Person"> <f:param name="personId"/> </s:link>
As for your problem with the conversation propagating, you have to realize that page parameters are tricky because they
activate
components during page transitions, which can sometimes result in the creation of a new component that gets attached to the next conversation. This is likely what is happening in your case. The best bet is to nullify the id so that things don't happen down the road. -
2. Re: Conversation state survives conversation end?
adamw Jun 14, 2008 4:11 PM (in response to adamw)Ah, of course, thanks for the answer :)
But anyway, why doesn't my method work? The component that the method parameter
activates
should be in the new conversation, so it shouldn't have the parameter set.As I understand what Seam does:
- after the persist method is invoked, the conversation is ended
- redirect to /persons/home.xhtml
- the new view is rendered - this involves starting a new conversation
- the s:link tag reads the parameter from the current conversation state
Where am I wrong? :)
Adam
-
3. Re: Conversation state survives conversation end?
dan.j.allen Jun 14, 2008 6:59 PM (in response to adamw)Your bullets are correct. I can't explain what is going on without seeing more of the code. One possibility is that you are ending a nested conversation and the personHome is still defined in the parent conversation. Inspect the /debug.seam page and verify that after you return to the home page that there are no conversations active.
As a general rule, I recommend two things when working with conversation. First, create a conversation switcher so that you can always see what conversations you have going. Second, keep the /debug.seam page open in another tab so that you can inspect what is in those conversations. -
4. Re: Conversation state survives conversation end?
adamw Jun 18, 2008 11:25 AM (in response to adamw)There are no nested conversations, and the /debug.seam page didn't tell me much ... here's example code if you'd like it:
convtest
(seam 2.0.2.sp1, the package is missing the lib dir as it's huge :) )--
Adam -
5. Re: Conversation state survives conversation end?
joblini Oct 29, 2008 4:00 AM (in response to adamw)After screwing around for 3 hours, I finally crafted my magic command:
<s:button id="create" value="Create" view="/myView.xhtml" propagation="none" > <f:param name="entityId"/> </s:button> |
This, on the other hand, does NOT end the conversation, and I can't understand why:
<h:commandButton id="create" value="Create" action="#{controller.create}" /> public String create() { return Constants.SUCCESS; } <navigation from-action="#{controller.create}"> <rule> <end-conversation/> <redirect/> </rule> </navigation> 22:41:01,717 DEBUG [org.jboss.seam.core.Manager] Restoring conversation with id: 1
I wish that there was more about this in the Seam documentation!