-
1. Re: [2.0beta1]s:button + pages.xml behaviour change
gavin.king Jul 5, 2007 3:22 PM (in response to ellenzhao)It should work. Put a breakpoint in Pages.callAction() and find out why the navigation rule doesn't get triggered.
Let me know how you go. -
2. Re: [2.0beta1]s:button + pages.xml behaviour change
ellenzhao Jul 5, 2007 5:19 PM (in response to ellenzhao)Ah sorry, there is copy&paste mistake in my last post. It should be:
I had this code always worked prior to the migration to 2.0 beta1:
in the new-recipe.xhtml:<s:button value="Cancel Creating New Recipe" action="#{recipeManager.cancelNewRecipe}" />
... (the rest is the same)
Sorry for the confusion. And I'll post investigation of this behaviour in minutes.... -
3. Re: [2.0beta1]s:button + pages.xml behaviour change
ellenzhao Jul 5, 2007 5:40 PM (in response to ellenzhao)Here is the first experiment I did today.
in the new-recipe.xhtml:... <s:link value="Add an ingredient" action="#{ingredientManager.startAddAnIngredient(recipeManager.recipe)}" /> ... <s:button value="Cancel Creating New Recipe" action="#{recipeManager.cancelNewRecipe}" /> ...
in the pages.xhtml, at first it was like below. It prevented the "Cancel Creating New Recipe" button redirecting to /home.xhtml:<page view-id="/new-recipe.xhtml"> <navigation from-action="#{ingredientManager.startAddAnIngredient(recipeManager.recipe)}"> <redirect view-id="/new-recipe.xhtml" /> </navigation> </page> <page view-id="/new-recipe.xhtml"> <navigation from-action="#{recipeManager.cancelNewRecipe}"> <redirect view-id="/home.xhtml" /> </navigation> </page>
When I modified the code in page.xhtml like below (disabled the first block), the "Cancel..." button worked! And, the "Add an ingredient" link worked correctly too, even if I commented the first block out.<!-- <page view-id="/new-recipe.xhtml"> <navigation from-action="#{ingredientManager.startAddAnIngredient(recipeManager.recipe)}"> <redirect view-id="/new-recipe.xhtml" /> </navigation> </page> --> <page view-id="/new-recipe.xhtml"> <navigation from-action="#{recipeManager.cancelNewRecipe}"> <redirect view-id="/home.xhtml" /> </navigation> </page>
-
4. Re: [2.0beta1]s:button + pages.xml behaviour change
ellenzhao Jul 5, 2007 5:45 PM (in response to ellenzhao)Then I thought maybe both actions from the same page confused the processor of the pages.xml. But I also have code like this in the pages.xml, both buttons on the /register.xhtml worked very well!
<page view-id="/register.xhtml"> <navigation from-action="#{userManager.register}"> <redirect view-id="/home.xhtml" /> </navigation> </page> <page view-id="/register.xhtml"> <navigation from-action="#{userManager.cancel}"> <redirect view-id="/home.xhtml" /> </navigation> </page>
both "register" and "cancel" buttons on the register.xhtml did redirect to /home.xhtml. -
5. Re: [2.0beta1]s:button + pages.xml behaviour change
ellenzhao Jul 5, 2007 6:00 PM (in response to ellenzhao)Here is the third experiment.
In home.xhtml:<rich:panel> <p>You can:</p> <ul> <li><s:link action="#{userManager.startRegistration}" value="Register as a new user" /></li> <li><s:link action="#{recipeManager.startNewRecipe}" value="Create Recipe"/></li> </ul> </rich:panel>
In the pages.xml:<page view-id="/home.xhtml"> <navigation from-action="#{userManager.startRegistration}"> <redirect view-id="/register.xhtml" /> </navigation> </page> <page view-id="/home.xhtml"> <navigation from-action="#{recipeManager.startNewRecipe}"> <rule if="#{recipeManager.recipe != null}"> <redirect view-id="/new-recipe.xhtml" /> </rule> </navigation> </page>
The first link does _not_ redirect but the second link redirects! In order to make the first link actually takes me to the registration page, I would have to say:<s:link action="#{userManager.startRegistration}" value="Register as a new user" view="/register.xhtml"/>
in the home.xhtml.
Strange thing....
My development environment is: Seam 2.0 beta 1 the latest build from CVS, Java 1.6. Debian Lenny amd64 kennel or Windows XP 32bits.
Thanks in advance for any enlightenment!
Best Regards,
Ellen -
6. Re: [2.0beta1]s:button + pages.xml behaviour change
ellenzhao Jul 5, 2007 6:21 PM (in response to ellenzhao)forgot to mention, all the action methods in the beans (userManager, recipeManager, ingredientManager.....) have the return type of void.
-
7. Re: [2.0beta1]s:button + pages.xml behaviour change
pmuir Jul 9, 2007 6:28 AM (in response to ellenzhao)Is this related to http://jira.jboss.com/jira/browse/JBSEAM-1574?
-
8. Re: [2.0beta1]s:button + pages.xml behaviour change
ellenzhao Jul 9, 2007 7:24 AM (in response to ellenzhao)Yes it is! By the way, I've doubled checked that all the actions expressed in the <s:link> or <s:button> were really executed and I did get the server side state as I wanted them to be. Only the page redirection did not happen anymore....
Thanks Pete!
Regards,
Ellen -
9. Re: [2.0beta1]s:button + pages.xml behaviour change
matt.drees Jul 9, 2007 11:04 AM (in response to ellenzhao)Is it legal to have multiple elements with the same view-id? I don't think it is... but I'd like to know if I'm wrong.
-
10. Re: [2.0beta1]s:button + pages.xml behaviour change
ellenzhao Jul 11, 2007 10:37 AM (in response to ellenzhao)Matt you are right. That was my mistake, sorry. I should have known more about the pages-2.0.xsd first.....Now I wrote the navigations this way:
<page view-id="/a.xhmtl">
...
...
...
all the navigation rules work fine now. :-)
Regards,
Ellen -
11. Re: [2.0beta1]s:button + pages.xml behaviour change
ellenzhao Jul 11, 2007 10:40 AM (in response to ellenzhao)sorry, I forgot to add the code tag...the code should be:
<page view-id="/a.xhtml"> <navigation>...</navigation> <navigation>...</navigation> ... </page>