Thursday, October 27, 2016

ADF Regions and Shared Data Control Bindings Use Case

While teaching ADF trainings and talking to ADF developers, often I can see people think about ADF bindings as about some mistery and try to avoid using full potential of ADF Data Control. I would like to give simple, but practical example in this post, which describes how to use ADF bindings and access these bindings across different ADF regions.

This diagram shows how sample application (BindingAccessApp.zip) is implemented:


There are two regions (task flows), both are configured with Shared Data Control (means they will share same AM instance). Employees region could change current row. From Jobs region we can access bindings updated in Employees (Email attribute in this case).

Two regions are rendered side by side. I can move to different row in Employees and press button Set Current. This will set displayed row as current:


Current row in Employees region is set through custom method:


Button in Jobs region - Show Employee displays Email value from Employees region. Such functionality can be important, when you need to implement data exchange functionality between regions. Simply rely on ADF bindings in Shared Data Control - this would work:


Main page contains both regions:


Email field value is set in Employees region, through ADF bindings:


Binding attribute for Email is defined in Page Definition and attached to Data Control:


Make sure TF is set to default Shared transaction, otherwise changes in the ADF bindings values will not be visible outside of current task flow/region:


Email attribute is referenced through the binding in Jobs region:


You must include Email attribute binding into Jobs region page definition. Its value will be automatically set to the one from Employees region:


Hopefully this will explain how powerful ADF bindings are.

1 comment:

Vladimir Zhilyaev said...

It works =)
Really simple way to get access to bindings from regions.
Thanks, Andrejus

Vladimir