-
1. Re: Problems with navigations with null outcomes
pmuir Feb 17, 2007 6:15 PM (in response to fernando_jmt)Try
<page view-id="/user/new.xhtml" no-conversation-view-id="/user/list.xhtml"> <navigation from-action="#{userManager.create}"> <rule if-outcome="userList"> <redirect view-id="/user/list.xhtml"/> </rule> </navigation> </page>
-
2. Re: Problems with navigations with null outcomes
fernando_jmt Feb 17, 2007 9:47 PM (in response to fernando_jmt)Yes, adding from-outcome works. I also did that before posting here.
So, this means we need to add a rule even for null outcomes?
I had seen in the seam reference (1.1.6GA), page 87, this:
"Null outcomes are a special case in JSF. The null outcome is interpreted to mean "redisplay the page". The following
navigation rule matches any non-null outcome, but not the null outcome:"<page view-id="/editDocument.xhtml"> <navigation from-action="#{documentEditor.update}"> <rule> <render view-id="/viewDocument.xhtml"/> <rule/> </navigation-case> </navigation-rule>
So, should the reference be updated?
Or? -
3. Re: Problems with navigations with null outcomes
gavin.king Feb 17, 2007 9:51 PM (in response to fernando_jmt)The docs are correct, are you sure you are really observing this?
-
4. Re: Problems with navigations with null outcomes
gavin.king Feb 17, 2007 10:06 PM (in response to fernando_jmt)I just retested this. A never matches a null outcome.
-
5. Re: Problems with navigations with null outcomes
fernando_jmt Feb 18, 2007 8:19 AM (in response to fernando_jmt)"gavin.king@jboss.com" wrote:
The docs are correct, are you sure you are really observing this?
Yes, I am sure.
I have this in pages.xml<page view-id="/user/new.xhtml" no-conversation-view-id="/user/list.xhtml"> <navigation from-action="#{userManager.create}"> <rule> <redirect view-id="/user/list.xhtml"/> </rule> </navigation> </page>
And this in my create method:public String create() { try { em.persist(user); em.flush(); facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_INFO, "Common.message.created", user.getFullName()); return "userList"; } catch (EntityExistsException e) { facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR, "User.error.duplicate"); return Outcome.REDISPLAY; } }
And it doesn't work. I'm always getting the error messages (cause of EntityExistsException caught):
* The username is already registered.
* Transaction failed
in the list.xhml instead of the new.xhtml view.
I'm using
tomcat 5.5.17
java 1.5.x
Seam 1.1.6GA CVS build at 02/12/2007
Any ideas why am I getting this behaviour?
Thanks. -
6. Re: Problems with navigations with null outcomes
gavin.king Feb 18, 2007 11:59 AM (in response to fernando_jmt)Return "null", not "Outcome.REDISPLAY" if you are using current CVS. Outcome.REDISPLAY is only meant for use inside annotations, and the old OutcomeInterceptor was recently removed, to help reduce stacktraces and increade performance.
-
7. Re: Problems with navigations with null outcomes
fernando_jmt Feb 18, 2007 1:16 PM (in response to fernando_jmt)"gavin.king@jboss.com" wrote:
Return "null", not "Outcome.REDISPLAY" if you are using current CVS. Outcome.REDISPLAY is only meant for use inside annotations, and the old OutcomeInterceptor was recently removed, to help reduce stacktraces and increade performance.
I tried with both. And neither null or Outcome.REDISPLAY works."fernando_jmt" wrote:
In the both cases (a, b) after userManager.create() returns null or Outcome.REDISPLAY the current page is not redisplayed, I always get the list.xhtml page.
I'll try with a recent CVS copy again. If it will not work, I'll tell you. -
8. Re: Problems with navigations with null outcomes
fernando_jmt Feb 18, 2007 1:18 PM (in response to fernando_jmt)"gavin.king@jboss.com" wrote:
Return "null", not "Outcome.REDISPLAY" if you are using current CVS. Outcome.REDISPLAY is only meant for use inside annotations, and the old OutcomeInterceptor was recently removed, to help reduce stacktraces and increade performance.
I tried with both. And neither null or Outcome.REDISPLAY works."fernando_jmt" wrote:
In the both cases (a, b) after userManager.create() returns null or Outcome.REDISPLAY the current page is not redisplayed, I always get the list.xhtml page.
I'll try with a recent CVS copy again. If it will not work, I'll tell you. -
9. Re: Problems with navigations with null outcomes
gavin.king Feb 18, 2007 1:43 PM (in response to fernando_jmt)I simply don't believe this (because I tested it), so you'll need to debug into the Seam source code, by putting a breakpoint in Pages.navigate(), and find the reason.
-
10. Re: Problems with navigations with null outcomes
fernando_jmt Feb 19, 2007 2:06 PM (in response to fernando_jmt)Gavin,
After I spent a lot of time trying to make this works (changing examples, from 1.1.6, CVS, debugging Seam code and so on), I found the reason:
The problem was that I was using the el-ri.jar which comes with ICEFaces 1.5.3 distribution.
I change back to el-ri.jar from Seam distribution and all works fine.
I don't know why this happen, it seems they are different implementations, even the size is different (IceFaces 97Kb, Seam 95Kb form el-ri.jar).
Do you know something related this?
Anyway, Thanks you for your help.