-
1. Re: clarification about propagation=
gavin.king Mar 30, 2007 12:48 PM (in response to codelion)Um. Dude. How the hell am I supposed to know what conversation you want to end when clicking the link if I don't pass the conversation id??!
-
2. Re: clarification about propagation=
codelion Apr 2, 2007 5:36 AM (in response to codelion)I admit, you have to know what conversation to end. I looked closer at what I'm doing, and the problem/question seems to be:
Should propagation="end" end the conversation when entering the target page or when leaving (!) the target (!) page?
I argue it should when entering, but it apparently does when leaving.
In my test case I am coming via<s:link view="/myOther.xhtml" value="Outta Here" propagation="end" />
into page myOther.xhtml that coincidentally also has in its myOther.page.xml<page> <begin-conversation join="true" /> </page>
My thought was like this: The propagation="end" means to end the conversation it was coming from (in my.xhtml).
End it. Now. First thing when dealing with conversations in the JSF Request-Response Life Cycle. Where in Seam Reference 6.1 it says "At the end of the restore view phase of the JSF request lifecycle, Seam attempts to restore any previous long-running conversation context. If none exists, Seam creates a new temporary conversation context."
I'd expect the propagation="end" at that point to make that conversation go away, and hence fulfill the "none exists" test.
If I have a propagation="none" it is gone indeed.
But if I have propagation="end" then the conversation still is there, and begin-conversation picks it up.
Me thinks this just happened as implementation detail, implementing propagation="end" like or similar to @End or like end-conversation, while it should be implemented to be effective at the same time as propagation="none" would be. -
3. Re: clarification about propagation=
pmuir Apr 3, 2007 11:47 AM (in response to codelion)Of course propagation="end" works the same as
<end-conversation />
and @End - that's certainly it's contract!. Remember that what end actually does is demote the long running conversation to temporary. So, you demote your lrc to temporary and hence the lrc context is still available at the next request but the conversation is temporary.
You need to use<end-conversation beforeRedirect="true" />(on the navigation rule, and then you can do a begin-conversation in your destination.page.xml) to get the behaviour you're after.
-
4. Re: clarification about propagation=
codelion Apr 3, 2007 2:10 PM (in response to codelion)Then how about introducing propagation="kill" which mostly works like propagation="none" but doesn't let the conversation linger around until it times out.
As I want to use these inside <s:link/> and not inside navigation rules that beforeRedirect="true" doesn't work for me, does it? -
5. Re: clarification about propagation=
pmuir Apr 3, 2007 2:11 PM (in response to codelion)Put a feature request in for beforeRedirect on s:conversationPropagation in JIRA
-
6. Re: clarification about propagation=
codelion Apr 3, 2007 3:24 PM (in response to codelion)Pete, I think you're thinking of uses of s:link with action="some.action", while...
I'm thinking of uses of s:link with view="/some.xhtml".
There is no action involved. I don't think there is a redirect. Right off to the target page with a GET from a URL, render it, done.
I want to use s:link, with all its functionality, benefits, etc. Just, please, kill that old conversation.
That said, I don't think "beforeRedirect on s:conversationPropagation" would be the answer. Right or wrong? Just trying to be correct. -
7. Re: clarification about propagation=
pmuir Apr 3, 2007 4:57 PM (in response to codelion)oic - oops.
Ok, I think that what you are after doesn't fit into the way Seam's conversations work - it's this whole thing about end not ending a conversation, just demoting it.
Put it in JIRA as a feature request and see what Gavin says - perhaps I'm wrong - but especially as the functionality you are after *is there* if you do this via navigation rules... -
8. Re: clarification about propagation=
codelion Apr 3, 2007 10:38 PM (in response to codelion)Found something that works as I want it to:
<s:link view="/myOther.xhtml" action="#{conversation.end}" value="Outta Here" />
Not sure whether to call that syntax sweet, but it seems to work. -
9. Re: clarification about propagation=
codelion Apr 4, 2007 2:31 AM (in response to codelion)I recant. The <s:link view="/myOther.xhtml" action="#{conversation.end}" value="Outta Here" /> doesn't work like an action on the source page, but on the target page.
Now I have tested it works to write one component likeimport org.jboss.seam.annotations.Name; import org.jboss.seam.core.Conversation; @Name("conversaction") public class Conversaction { public String endAndTo(String viewId) { Conversation.instance().end(); return viewId; } }
and to have link from source page /my.xhtml like<s:link action="#{conversaction.endAndTo('/myOther.xhtml')}" value="Outta Here" />
On the down side it appears that any <f:param name="paramToMyOtherName" value="paramToMyOtherValue" /> doesn't arrive at the target page.
Also, regrettably, it does cost an extra redirect.
Would have been nicer instead to have used a built-in<s:link view="/myOther.xhtml" propagation="kill" value="Outta Here" />
-
10. Re: clarification about propagation=
vdanda Jun 28, 2007 11:50 AM (in response to codelion)In my app, whenever user clicks on some of the menu links I am starting the new conversation and specifying the propagation="end" on every menu link. My expectation is to kill the current conversation whenever click on link. Right now what's happening is its not complaining on creating the new conversation but the previous conversation data is carry over to the new one.
If you introduce propagation='kill', does my problem is going to resolve? I would appreciate if anyone suggests work around/solution to the problem.