BAM Data Control in multiple ADF Faces Components

Posted by [email protected] on Oracle Blogs See other posts from Oracle Blogs or by [email protected]
Published on Mon, 12 Apr 2010 20:27:53 +0000 Indexed on 2010/04/12 23:34 UTC
Read the original article Hit count: 502


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  from

Sample1.zip


Set-up:


Create a BAM data control using employees DO (sample)


Steps:

  1. Right click on View Controller project and select "New->ADF Task Flow"

  2. Check "Create Bounded Task Flow" and give some meaningful name (ex:EmpPieTF.xml ) to the TaskFlow(TF) and click on "OK"

    CreateTF.bmp
  1. From the "Components Palette", drag and drop "View" into the task flow diagram. Give a meaningful name to the view.

  2. Double Click and Click "Ok" for  "Create New JSF Page Fragment"

  3. From "Data Controls" drag and drop "Employees->Query"  into this jsff page as "Graph->Pie" (Pie: Sales_Number and Slices: Salesperson)

  4. Repeat step 1 through 4 for another Task Flow (ex: EmpBarTF).

  5. From "Data Controls" drag and drop "Employees->Query"  into this jsff page as "Graph->Bar" (Bars :Sales_Number and X-axis : Salesperson).

  6. Open the Taskflow created in step 2.

  7. In the Structure Pane, right click on "Task Flow Definition -EmpPieTF"

  8. Click "Insert inside Task Flow Definition - EmpPieTF -> ADF Task Flow -> Data Control Scope". Click "OK"


    TFDCScope.bmp
  1. For the "Data Control Scope", In the Property Inspector ->General section, change data control scope from Shared to Isolated.

  2. Repeat step 8 through 11 for the 2nd Task flow created.

  3. Now create a new jspx page example: Main.jspx

  4. Drag and drop both the Task flows (ex: "EmpPieTF" and "EmpBarTF") as regions. Surround with panel components as needed.
  5. Run the page Main.jspx

MainPage.bmp

Now 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.






© Oracle Blogs or respective owner

Related posts about BAM Data Control multiple