Tuesday, March 9, 2010

Integration in Oracle ADF with ADF Task Flows and Dynamic Regions Navigation

Today one more post from Integration series. There is a case, when Dynamic Region might have navigation to another Dynamic Region. If user will open one region from another, menu selection should be refreshed accordingly. I'm describing how to do this, thanks to blog Reader who asked this question.

Download updated sample - ADFIntegrationRegions3.zip, based on my previous post. Main change comparing to previous post sample - there is ADF Task Flow call from Locations to Departments:


All separate applications are deployed and assembled into one main application, same as it was described before. Only one difference now - first Dynamic Region (Locations) contains Departments buttons, it will navigate to second Dynamic Region (Departments) directly:


User can click on Departments button:


And here we go - Departments Dynamic Region is opened, menu item selection is synchronized as well:


Well, how to implement this? There is a very good hint in Frank Nimphius and Lynn Munsinger book (Building RIAs w/ Oracle ADF) on page #201 RegionNavigationListener. We can declare it for af:region:


And listen for navigation from Locations to Departments, if such navigation happens - we reset menu and switch Dynamic Region (Departments) as current:


Its how it works.

6 comments:

Tiah said...

Hello Andrejus,

Thank you very much for your very useful ADF examples. The examples are very handy to learn many key concepts.

My client has the following requirement. They would like to use region+dynamic task flows concept to bring in different task flows based on some condition.

How one can pass parameters to each of these dynamically instantiated task flows in a region?

Appreciate your feedback,
Thanks,
Tiah

Andrejus Baranovskis said...

Hi Tiah,

You can enable this programatically, from the same dynamic task flow bean class. It should work.

Andrejus

Srini.A said...

Hi Andrejus,

Thanks for the post. I am trying to work on a simpler than this. But not able to get it. I want to tell the button action from one region to another region. First region has two buttons and second region should display a screen based on the selection of the button in the first region.

I am using the following after raising the contextual event on the button in the first region.
public void receiveButtonEvent (ActionEvent actionEvent03){

RichCommandButton rcb = (RichCommandButton)actionEvent03.getComponent();
System.out.println("Action Text = "+rcb.getText());
String prAction =
}

I am not able to get the action. Is this correct?

Andrejus Baranovskis said...

May be you are trying to implement it too complex. Why not to use just Input Parameter for fragment and to do PPR on that fragment?

Andrejus

Anonymous said...

Hi Andrejus,

Thanks for the post. I have a requirement where I need to display a static TF with a dynamic region. In the static TF, I have a view with 2 dropdown lists and based on the selection in these lists the dynamic region below should load the corresponding TF. But my problem is I dont want to use TF call activity as upon selecting any value from the list, the whole page would be replaced by dynamic region. I want to show the dynamic region with the two lists always. Am I correct in analyzing my solution.

Please guide.

Thanks,
Vikas.

Andrejus Baranovskis said...

Yes..., I would suggest to use Managed Bean, you can pass dummy parameter through that Bean from static task flow and use it as parameter for Dynamic Task Flow. Set refresh ifNeeded - it will get reloaded.

Andrejus