[
http://jira.jboss.com/jira/browse/JBSEAM-906?page=comments#action_12354066 ]
Christian Bauer commented on JBSEAM-906:
----------------------------------------
With this, the only remaining challenge is getting the 'redirect' component
prepared and set when you start a RC. I had a few discussions about this with Gavin, and I
think a generic or preferred solution is still not present (or at least not obvious to
me).
How do you start a RC and get the 'redirect' component into it? First you need to
prepare it with 'redirect.captureCurrentRequest()', and the current request is the
one you will return to when you Cancel the RC.
Solution 1:
display.xhtml
<s:link action="edit"/>
pages.xhtml
<page view-id="/display.xhtml"
action="#{redirect.captureCurrentRequest()}">
<navigation>
<rule if-outcome="edit">
<begin-conversation/>
<redirect view-id="/edit.xhtml"/>
</rule>
</navigation>
</page>
Advantage: Easy, other stuff that also needs to be prepared before the conversation is
promoted, like any request parameters to pass into the conversation, can be encapsulated
in the page action as well.
Disadvantage: Can't call 'redirect.execute()' to get out of the RC because
there are actionMethod and actionOutcome parameters on the captured request. Need to strip
off these first.
Eh, other solutions?
Support redirect component for navigation out of conversational
scope
---------------------------------------------------------------------
Key: JBSEAM-906
URL:
http://jira.jboss.com/jira/browse/JBSEAM-906
Project: JBoss Seam
Issue Type: Feature Request
Components: Core
Reporter: Christian Bauer
Priority: Minor
It's about my favorite subject, the "history" or "cancel"
button.
Assume the following (RC == Root Conversation, NC == Nested Conversation):
RC(1) -> NC(2) -> NC(3)
I can render a Cancel button on each page in NC 2 and 3 with the
action=#{conversation.endAndRedirect()} to get back to any parent NC or RC.
I can not render a Cancel button on each page in RC, because there is no "parent
view-id" we could redirect to. So my Cancel button on these pages has to call some
logic I've written on my RC backing component.
I propose to extend the Conversation.endAndRedirect() method with the following logic:
- If called in a NC, do what it currently does.
- If called in a RC, check if the 'redirect' component is present in RC, if yes,
call 'redirect.execute()'
If this would be available, I could completely control conversation navigation and the
navigation history through nesting conversations (with s:link or pages.xml) and by
ensuring that a RC has a prepared 'redirect' component when it is started. All
Cancel buttons would be able to use action="#{conversation.endAndRedirect()}"
and would either get the user "one up" in the conversation stack or
"out" of conversational scope.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira