This content has been marked as final.
Show 1 reply
-
1. Re: Differentiate between buttons without action in pages.xml
dan.j.allen Apr 24, 2009 1:19 AM (in response to thekonstantin)You can distinguish between the two buttons by assigning a logical outcome to each one:
<h:commandButton id="viewButton" action="view" value="Click here to View the current entity."/> <h:commandButton id="editButton" action="edit" value="Click here to edit the current entity."/>
Then you can refer to these outcomes in your navigation rules:
<page view-id="/mypage.xhtml"> <navigation> <rule if-outcome="view"> <redirect view-id="/viewpage.xhtml"/> </rule> <rule if-outcome="edit"> <redirect view-id="/editpage.xhtml"/> </rule> </navigation> </page>
However, you cannot execute actions inside of rules. The best you can do is raise an event which an observer will observe and execute logic.