Sunday, August 22, 2010

JSF Page navigation using RAD 7 Add Rule feature

JSF provides page navigation using navigation-rule of faces-config.xml file. In this rule, you need to mention source JSP, destination JSP file and a token which returns from managed-bean method.
I will do the same thing using ‘Add Rule’ feature of RAD 7. Let’s see how we can do it?

First you need to open the JSP page in design view and single click on ‘SAVE’ button. Thereafter, you need to select ‘Properties’ tab (Lower middle portion of RAD) and then select ‘hx:commandExButton’ option. There you can see Add Rule button.

Please click on ‘Add Rule’ button (Right upper portion of properties tab). You will get ‘Add Navigational Rule’ window. Here you will mention final JSP page, the outcome name and action if required. Press OK button once you fill all the required information.






You can see the added code in faces-config.xml file as,

<navigation-rule>
 <from-view-id>/UserInformationView.jsp</from-view-id>
  <navigation-case>
   <from-outcome>success</from-outcome>
   <to-view-id>/UserInfoDetails.jsp</to-view-id>
  </navigation-case>
</navigation-rule>

No comments: