[
http://jira.jboss.com/jira/browse/JBSEAM-1574?page=comments#action_12370309 ]
Michael Youngstrom commented on JBSEAM-1574:
--------------------------------------------
Or perhaps maybe the best solution would be to check no-conversation-required and
is-login-required before the action and after. That way the page action won't be
called if they're not logged it or the conversation has ended since their last
request.
Index: src/main/org/jboss/seam/navigation/Pages.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/navigation/Pages.java,v
retrieving revision 1.11
diff -u -r1.11 Pages.java
--- src/main/org/jboss/seam/navigation/Pages.java 25 Jul 2007 14:40:31 -0000 1.11
+++ src/main/org/jboss/seam/navigation/Pages.java 27 Jul 2007 19:47:00 -0000
@@ -272,6 +270,7 @@
//redirect if necessary
List<Page> pageStack = getPageStack(viewId);
+
for ( Page page: pageStack )
{
if ( isNoConversationRedirectRequired(page) )
@@ -285,19 +284,36 @@
return false;
}
}
-
- //run the page actions, check permissions,
- //handle conversation begin/end
- boolean result = false;
- for ( Page page: pageStack )
- {
- result = page.preRender(facesContext) || result;
- }
//run the s:link / s:button action after checking the
//conversation existence!
- result = callAction(facesContext) || result;
-
+ boolean result = callAction(facesContext);
+
+ //If responseComplete then we're probably doing a redirect so don't call
the page actions now.
+ if(!facesContext.getResponseComplete()) {
+ for ( Page page: pageStack )
+ {
+ if ( isNoConversationRedirectRequired(page) )
+ {
+ redirectToNoConversationView();
+ return false;
+ }
+ else if ( isLoginRedirectRequired(viewId, page) )
+ {
+ redirectToLoginView();
+ return false;
+ }
+ }
+
+ //run the page actions, check permissions,
+ //handle conversation begin/end
+ String newViewId = getViewId(facesContext);
+ for ( Page page: getPageStack(newViewId) )
+ {
+ result = page.preRender(facesContext) || result;
+ }
+ }
+
return result;
}
pages.xml actions are not called when using "render" with
s:link and s:button
-----------------------------------------------------------------------------
Key: JBSEAM-1574
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1574
Project: JBoss Seam
Issue Type: Bug
Components: JSF
Affects Versions: 2.0.0.BETA1
Reporter: Michael Youngstrom
Assigned To: Gavin King
Fix For: 2.0.0.CR1
<page view-id="/list.xhtml">
<navigation>
<rule if-outcome="detail">
<render view-id="/detail.xhtml"/>
</rule>
</navigation>
</page>
<page view-id="/detail.xhtml"
action="#{bean.loadDetail}"/>
Does not appear to call #{bean.loadDetail} when the list navigation rule is executed.
Mike
--
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