There is a great video from Frank Nimphius - How-to use Contextual Events in ADF Region Interaction. Frank explains how you can trigger refresh and pass data between two independent regions using ADF Contextual Framework. While this works great, sometimes you may need something more simpler. I decided to explain another option - how to trigger refresh between two independent regions using ADF Task Flow parameters. Its just another option, you should use ADF Contextual Events Framework in most of the cases, but it always good to know alternatives. Described solution will work for the regions based on the shared Data Control.
Download sample application - RegionCommunicationPPR.zip. This sample is based on two ADF Regions - one brings Employees table data, another - Employes form data. User can select data in the table, form in the second ADF Region will be refreshed automatically and will show synchronized data.
Two ADF Regions:
How we can trigger second ADF Region refresh based on the changes from the first ADF Region? We will use ADF Task Flow parameters for the second ADF Region:
Its enough just to define parameter, no need to use - it is needed only to trigger refresh, the rest will be done automatically, because both regions are based on the same Data Control.
Next, we go to Page Definition file where both ADF Regions are declared:
Edit second ADF Region - employeesformflow1, its where we have declared Input Parameter. Make sure that Input Parameter value is not empty:
Here is a main trick of this post - Input Parameter of the second ADF Region should get value from EmployeeId attribute in the first ADF Region:
And second point - Refresh condition for the second ADF Region must be set to ifNeeded. This will make sure, that each time when input parameter value will be changed, it will trigger refresh for the second ADF Region and synchronize data:
Table selection from the first ADF Region triggers refresh in the second and shows the same row:
If you select another row - both table and form are synchronized again. Change Salary attribute value from 9000 to 10000:
Press Save button - changes will be stored and both ADF Regions are synchronized: