-
1. Re: Programmatic arbitrary redirection inside pageflow
thejavafreak Oct 17, 2007 8:45 PM (in response to igx89)Then why did you put ?
-
2. Re: Programmatic arbitrary redirection inside pageflow
thejavafreak Oct 17, 2007 8:46 PM (in response to igx89)Then why did you put ?
-
3. Re: Programmatic arbitrary redirection inside pageflow
thejavafreak Oct 17, 2007 8:47 PM (in response to igx89)Then why did you put
<transition to="next">
-
4. Re: Programmatic arbitrary redirection inside pageflow
igx89 Oct 18, 2007 12:31 AM (in response to igx89)because 99% of the time I do want to go there, but there are certain edge cases where I'd need to go somewhere else. I could just put it in as part of the pageflow logic, I know, but that'd get awfully clunky to have a decision node for every transition for a page (for 10 pages with 2 transitions each, that'd be 20 decision nodes to add -- no way should that be required!).
I would use exceptions, but they're logged (naturally want only exceptions caused by bugs/problems to be logged) and even then I couldn't show a message (because of this Seam bug: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=105236 -
5. Re: Programmatic arbitrary redirection inside pageflow
thejavafreak Oct 18, 2007 3:24 AM (in response to igx89)Try to use
<decision />
. I think that is more relevant to your case -
6. Re: Programmatic arbitrary redirection inside pageflow
igx89 Oct 18, 2007 9:29 AM (in response to igx89)That's what I just said I definitely don't want to use...
Anyone else? -
7. Re: Programmatic arbitrary redirection inside pageflow
smithbstl Oct 18, 2007 10:53 AM (in response to igx89)You could do away with pageflows and use pages.xml for your navigation logic. You could then just return the view as a string from your method.
http://docs.jboss.com/seam/2.0.0.CR2/reference/en/html_single/#d0e5182If you find navigation rules overly verbose, you can return view ids directly from your action listener methods:
public String guess() { if (guess==randomNumber) return "/win.jsp"; if (++guessCount==maxGuesses) return "/lose.jsp"; return null; }
Note that this results in a redirect..... -
8. Re: Programmatic arbitrary redirection inside pageflow
igx89 Oct 18, 2007 10:56 AM (in response to igx89)Pageflows provide way, way too many benefits over pages.xml for me to consider that :/.
-
9. Re: Programmatic arbitrary redirection inside pageflow
pmuir Oct 18, 2007 12:01 PM (in response to igx89)You should almost certainly use decision nodes rather than hack apart the pageflow system.
-
10. Re: Programmatic arbitrary redirection inside pageflow
igx89 Oct 18, 2007 12:39 PM (in response to igx89)Are you saying it's not/shouldn't be possible then? In that case, I'll just hope the exception message bug gets fixed soon and just train myself to ignore all the stack traces in the logs :/
-
11. Re: Programmatic arbitrary redirection inside pageflow
pmuir Oct 18, 2007 4:23 PM (in response to igx89)You haven't convinced me that it should implemented in Seam, no. For me, a lot of the point of a pageflow is that it clearly shows all the paths of execution.
-
12. Re: Programmatic arbitrary redirection inside pageflow
igx89 Oct 18, 2007 4:32 PM (in response to igx89)My use case is that I want the ability to programmatically show simple messages to the user and then end the pageflow when they click "Ok" on the message page. The reason for that is for edge cases where certain conditions arise where the user shouldn't continue any further in the pageflow.
In psuedo-code, it'd look like:if(someEdgeCondition) { Message "Sorry, but you can't continue. Please try again once you fix it." EndPageflow }
Basically just like exception throwing should work, except without the long, multiple stack traces being put into the webapp's error log. -
13. Re: Programmatic arbitrary redirection inside pageflow
igx89 Oct 18, 2007 4:42 PM (in response to igx89)If that still doesn't convince you, then you should make Pageflow.reposition protected instead of public, or at least put javadoc on it saying that it doesn't work when called externally...
-
14. Re: Programmatic arbitrary redirection inside pageflow
pmuir Oct 24, 2007 12:18 PM (in response to igx89)If you are sure reposition doesn't work then you should file a jira issue with a test-case showing it not working so we can fix it :)