ADF Code Corner How-to declaratively build a master-detail behavior with DVT components. Abstract: twitter.com/adfcodecorner

Similar documents
ADF Code Corner How-to further filter detail queries based on a condition in the parent view using ADF BC. Abstract: twitter.

ADF Code Corner How-to enforce LOV Query Filtering. Abstract: twitter.com/adfcodecorner

ADF Code Corner. 70. How-to build dependent list boxes with Web Services Business Services. Abstract: twitter.com/adfcodecorner

ADF Code Corner. 90. Filtering ADF bound lists. Abstract: twitter.com/adfcodecorner

ADF Code Corner How-to use the af:autosuggestbehavior component tag with ADF bound data sources. Abstract: twitter.

ADF Code Corner. 64. How-to implement a Select Many Shuttle with pre- selected values. Abstract: twitter.com/adfcodecorner

ADF Code Corner. 016-How-to customize the ADF Faces Table Filter. Abstract: twitter.com/adfcodecorner

ADF Mobile Code Corner

ADF Code Corner How-to bind custom declarative components to ADF. Abstract: twitter.com/adfcodecorner

ADF Code Corner How to cancel an edit form, undoing changes with ADFm savepoints

ADF Code Corner How-to build a reusable toolbar with Oracle ADF Declarative Components. Abstract: twitter.com/adfcodecorner

ADF Mobile Code Corner

ADF Hands-On. Understanding Task Flow Activities / 2011 ADF Internal Enterprise 2.0 Training. Abstract:

ADF Code Corner How-to restrict the list of values retrieved by a model driven LOV. Abstract: twitter.com/adfcodecorner

ADF Code Corner How-to launch a popup upon rendering of a page fragment in a region using JSF 2. Abstract: twitter.

ADF Mobile Code Corner

ADF Code Corner How-to show a glasspane and splash screen for long running queries. Abstract: twitter.com/adfcodecorner

ADF Code Corner. 65. Active Data Service Sample Twitter Client. Abstract: twitter.com/adfcodecorner

ADF Mobile Code Corner

ADF Code Corner. 048-How-to build XML Menu Model based site menus and how to protect them with ADF Security and JAAS. Abstract:

ADF Code Corner. 97. How-to defer train-stop navigation for custom form validation or other developer interaction. Abstract: twitter.

ADF Code Corner Implementing auto suggest functionality in ADF Faces. Abstract:

ADF Code Corner. 71. How-to integrate Java Applets with Oracle ADF Faces. Abstract: twitter.com/adfcodecorner

Oracle Fusion Middleware 11g: Build Applications with ADF Accel

ADF Code Corner. Oracle JDeveloper OTN Harvest 02 / Abstract: twitter.com/adfcodecorner

Oracle Fusion Middleware 11g: Build Applications with ADF I

ADF Code Corner. Oracle JDeveloper OTN Harvest 09 / Abstract: twitter.com/adfcodecorner

Oracle Fusion Middleware 11g: Build Applications with ADF I

Oracle Middleware 12c: Build Rich Client Applications with ADF Ed 1 LVC

Mastering Oracle ADF Task Flows. Frank Nimphius Principal Product Manager Oracle JDeveloper / ADF

Oracle Fusion Developer Guide (ISBN: ) Preview Chapter 1. The Quick Lerner s Guide to Oracle Fusion Web Application Development PREVIEW

ADF Code Corner. Oracle JDeveloper OTN Harvest 01 / Abstract: twitter.com/adfcodecorner

ADF Code Corner. Oracle JDeveloper OTN Harvest 10 / Abstract: twitter.com/adfcodecorner

Oracle Fusion Middleware

ADF Code Corner How-to use Captcha with ADF Faces and Oracle ADF. Abstract: twitter.com/adfcodecorner

Oracle Retail Accelerators for WebLogic Server 11g

Managing Your Database Using Oracle SQL Developer

Rich Web UI made simple Building Data Dashboards without Code

Oracle ADF 11g: New Declarative Validation, List of Values, and Search Features. Steve Muench Consulting Product Manager Oracle ADF Development Team

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle Developer Day

ADF Region Interaction: External Train Navigation

The Tie That Binds: An Introduction to ADF Bindings

1z0-554qa88. Number: Passing Score: 800 Time Limit: 120 min File Version: 1.0. Oracle 1z0-554

Building Rich Enterprise JSF Applications with Oracle JHeadstart for ADF (11.1.1)

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle Exam 1z0-419 Oracle Application Development Framework 12c Essentials Version: 7.0 [ Total Questions: 87 ]

ORACLE JHEADSTART 12C for ADF

Overview. Principal Product Manager Oracle JDeveloper & Oracle ADF

Developing an ADF 11g client for Agile PLM. Developing an ADF 11g client for Agile PLM

<Insert Picture Here> Accelerated Java EE Development: The Oracle Way

Oracle Fusion Middleware

PassGuide..1z0-554_81,Q&A

An Oracle White Paper March Introduction to Groovy Support in JDeveloper and Oracle ADF 11g

Oracle Developer Day

Building J2EE Applications with Oracle JHeadstart for ADF

CHAPTER. Introduction to the Oracle Application Development Framework

Oracle Fusion Middleware

Case Study: Redeveloping an Oracle Forms application using Oracle JDeveloper and Oracle ADF

Oracle Application Development Framework Overview

Oracle Developer Day

6/13/2012. Sneak Preview: Oracle JDeveloper 12c New Features. Frank Nimphius Senior Principal Product Manager Oracle Development Tools

<Insert Picture Here> Advanced ADF Faces. Frank Nimphius Principal Product Manager

Oracle Developer Day

ADF Code Corner. Oracle JDeveloper OTN Harvest 12 / 2011 & 01 / Abstract: twitter.com/adfcodecorner

CIS 764 Tutorial: Log-in Application

<Insert Picture Here> JDeveloper Treasure Hunt

Understanding Oracle ADF and its role in the Oracle Fusion Platform

ADF Code Corner. Oracle JDeveloper OTN Harvest 12 / Abstract: twitter.com/adfcodecorner

Oracle ADF: The technology behind project fusion. Lynn Munsinger Principal Product Manager Application Development Tools Oracle Corporation

If you wish to make an improved product, you must already be engaged in making an inferior one.

MVC. Peter Koletzke, Quovera. Figure 1. MVC layers

ADF Code Corner. The Oracle JDeveloper Forum Harvest 10 / Abstract: twitter.com/adfcodecorner

ADF Code Corner. Oracle JDeveloper OTN Harvest 04 / Abstract: twitter.com/adfcodecorner

Getting started with ADF 11g

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Take Your Oracle Forms on the Road Using ADF Mobile. Mia Urman, OraPlayer & Denis Tyrell, Oracle Corporation

Oracle ADF Faces Cookbook

Oracle Fusion Middleware

1Z0-430

Oracle Fusion Middleware Developing Extensions for Oracle JDeveloper. 12c ( )

<Insert Picture Here> The Oracle Fusion Development Platform: Oracle JDeveloper and Oracle ADF Overview

DbSchema Forms and Reports Tutorial

Just Get It Written: Deploying Applications to WebLogic Server Using JDeveloper and WLS Console Hands on Practice

ADF OAF Who Cares? You Do! Oracle Applications Framework / Application Development Framework - Which way do I go?

ADF EMG XML Data Control. Powerful and Easy ADF Data Control for XML data

DbSchema Forms and Reports Tutorial

Achieving the Perfect Layout with ADF Faces RC

ADF Mobile : Data Services Java Beans. Ma Ping

TUTORIAL: ADF Faces (Part 1-Modified) Passing parameter values between JSF pages By: Dr.Ahmad Taufik Jamil, Pusat Teknologi Maklumat, HUKM

<Insert Picture Here> Oracle JHeadstart Forms2ADF - Overview

Oracle JDeveloper/Oracle ADF 11g Production Project Experience

Oracle WebCenter Hands-On Practices. A Practical Introduction to Oracle WebCenter

Apply a Design Pattern

ADF Desktop Integration 11g Release1 Component and Feature Demo

Table of contents. DMXzone Font Awesome DMXzone

Oracle Fusion Middleware

Oracle SQL Developer Workshop

Access Review. 4. Save the table by clicking the Save icon in the Quick Access Toolbar or by pulling

We didn t need dialogue. We had faces.

Transcription:

ADF Code Corner 057. How-to declaratively build a master-detail behavior with Abstract: A widely unknown feature in ADF bound ADF Faces DVT components is the ability to act as a master in a masterdetail relationship. This feature wasn't always in and in the past developers had to listen for the click event to perform this functionality using Java. This article explains how to declarative build a masterdetail behavior using ADF Faces. twitter.com/adfcodecorner Author: Frank Nimphius, Oracle Corporation twitter.com/fnimphiu 16-SEP-2010

Oracle ADF Code Corner is a loose blog-style series of how-to documents that provide solutions to real world coding problems. Disclaimer: All samples are provided as is with no guarantee for future upgrades or error correction. No support can be given through Oracle customer support. Please post questions or report problems related to the samples in this series on the OTN forum for Oracle JDeveloper: http://forums.oracle.com/forums/forum.jspa?forumid=83 Introduction ADF bound can be used as a master component in a master-detail relationship. This is not widely known, a good reason to write about it. The outcome of the steps explained in this sample tutorial is shown in the image below Figure 1: master-detail with DVT component as master 2

Clicking on a bar in the graph, the table is refreshed showing the details of the employees working in the selected department. Building the ADF BC model The ADF BC model is built based on the Departments and Employees table of the Oracle HR schema. You can select the View Object instances in the model view and use the right mouse button to give it a better name, as I did in the sample shown below. Figure 2: ADF BC data model with master-detail relationship In the Departments View Object, create a transient attribute "allsalary", set its type to "Number" and the value type "Expression". Then add the following Groovy Expression into the value field EmployeesView.sum('Salary') Note that if you used a different database schema, the accessor name "EmployeesView" would be different from the one used in the sample above. Building the Graph To build the graph, drag the Department View Object from the DataControl panel to the JSF page 3

Figure 3: Drag alldepartments as a Graph From the opened ADF binding menu, choose the Graph option Figure 4: Graph component menu and select the graph type of your choice. In this example, the graph type is chosen to be a bar graph. 4

Figure 5: Select a graph type In the Graph edit dialog, drag the allsalaries transient attribute to the "Bars" field and the "DepartmentName" attribute to the x-axis. Figure 6: Make sure you select the "Set current row for master..." option 5

Make sure you select the "Set current row for master-detail" checkbox, which will configure the graph for the master-detail behavior. Figure 7: Listener that handles the bar selection Selecting the "Set current row for master-detail" option adds a click listener configuration to the ClickListener property. The EL string referenced the DVT binding, a FacesCtrl binding class that has a processclick event handler. The processclick handler takes the clicked graph rowkey to set this as the selected row on the binding. This then changes the row currency of the dependent Employees iterator. To create the dependent Employees iterator, drag the "allemployeesindepartment" View Object as a table to the page. 6

Figure 8: Add a table based on the dependent employee View Object Select the table component and open the Property Inspector. Select the "PartialTriggers" property and choose the "Edit" option from the context menu. Figure 9: Configure the PartialTrigger property for the table In the opened dialog, select the graph component and press okay after shuttling it to the "Selected" list. The partial trigger setting ensures that a change on the graph always leads to a refresh of the dependent employees table. 7

Figure 10: Select the graph component to trigger a table refresh Note: Of course, you can implement your own click listener in a managed bean and programmatically set the current row on the detail iterator. This is what developers did before the "Set current row for master-detail" was added to the dialog Note: If you forgot to set the "Set current row for master-detail" select box, select the graph component in the visual editor, open the Property Inspector and press the "Edit Component Definition" pencil icon. Download The Oracle JDeveloper 11.1.1.3 sample workspace of this article is available on ADF Code Corner: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html Just make sure you change the database connection of the model to point to a local database of yours that has the HR schema installed RELATED DOCOMENTATION 8