04 – Basic page navigation

Prepare new application

Prepare clean ADF application workspace and open your unbounded TaskFlow (adfc-config.xml).

adf_tutorial_04_basic_page_navigation_01

Creating pages

Add three sites inside: mainPage.jsf, pageOne.jsff and pageTwo.jsff

adf_tutorial_04_basic_page_navigation_02

Double click on each for create every page.

adf_tutorial_04_basic_page_navigation_03

adf_tutorial_04_basic_page_navigation_04

On the main page add page label (outputText) on the top and button “Page One” in the “Content” facet. To do this just drag the controls from Components and drop to Structure Viewer.

adf_tutorial_04_basic_page_navigation_05

On the second page add two buttons “Main Page” and “Page Two”. On the last one: “Main Page” and “Page One”. Remember about page labels.

After that your pages should look similar like below.

adf_tutorial_04_basic_page_navigation_06

Define Control Flow cases

It’s time to add some navigation to our application. Open adfc-config.xml and connect using “Control Flow Case” activity each page like below.

adf_tutorial_04_basic_page_navigation_07

Now open each page and set “action” property for every button ie. on mainPage set “action” to “goOne”.

adf_tutorial_04_basic_page_navigation_08

Testing navigation

If you’ve done everything properly your application is ready for testing.

adf_tutorial_04_basic_page_navigation_09

Simplify navigation

If you see on your adfc-config.xml file, you see it’s little complicated. Let’s simplify control flow cases by using “Wildcard Control Flow Case”. Wildcard means, that the “case” is accessible from any page in the taskFlow.

In this case the mainPage is accessible from any other, so let’s change  navigation. Just add Wildcard activity and Control Flow Rule from Wildcard to mainPage like below.

adf_tutorial_04_basic_page_navigation_10

Test the application one more time.

There should be no difference in application behavior, but it is much easier to understand.

Facebooktwittergoogle_plusredditlinkedinmail

Leave a Reply

Feel free to ask me about anything!

Notify of
avatar
wpDiscuz