As we know Oracle BAM data control instance sharing is not supported.When two or
more ADF Faces components must display the same data, and are bound to
the same Oracle BAM data control definition, we have to make sure that we wrap each ADF
Faces component in an ADF task flow, and set the Data Control Scope to
isolated. This blog will show a small sample to demonstrate this.
In this sample we will
create a Pie and Bar using same BAM DC, such that both components use same Data control but have isolated scope.This sample can be downloaded fromSample1.zip
Set-up:
Create a BAM data control using
employees DO (sample)
Steps:
Right click on View Controller
project and select "New->ADF Task Flow"
Check "Create Bounded Task Flow" and give some meaningful name (ex:EmpPieTF.xml ) to the TaskFlow(TF) and click on "OK"CreateTF.bmpFrom the "Components Palette", drag
and drop "View" into the task flow diagram. Give a meaningful
name to the view.
Double Click and Click "Ok" for "Create New JSF Page Fragment"
From "Data Controls" drag and drop "Employees->Query" into this jsff page as "Graph->Pie" (Pie: Sales_Number and Slices: Salesperson)
Repeat step 1 through 4 for another Task Flow (ex: EmpBarTF).
From "Data Controls" drag and drop "Employees->Query" into this jsff page as "Graph->Bar" (Bars :Sales_Number and X-axis : Salesperson).
Open the Taskflow created in step
2.
In the Structure Pane, right click
on "Task Flow Definition -EmpPieTF"
Click "Insert inside Task Flow
Definition - EmpPieTF -> ADF Task Flow -> Data Control
Scope". Click "OK"TFDCScope.bmpFor the "Data Control Scope",
In the Property Inspector ->General section, change data control
scope from Shared to Isolated.
Repeat step 8 through 11 for the
2nd Task flow created.
Now create a new jspx page
example: Main.jspxDrag and drop both the Task flows (ex: "EmpPieTF" and "EmpBarTF") as regions. Surround with panel components as needed.Run the page Main.jspxMainPage.bmpNow when the page runs although both components are created using same Data control the bindings are not shared and each component will have a separate instance of the data control.