ADF 11g Placeholder Data Control – for off line demonstration of application and/or rapid UI prototyping without a need for a business service

ADF applications are typically heavily into data. One of the major strengths of the framework is the data binding layer that allows rapid development of complex user interfaces bound to underlying data controls. These data controls expose data sources such as relational databases, web services, content management systems, JMX beans (as of 11g), REST/URL services and plain files. ADF applications in the recent past had to be developed with all these data sources present – without them the UI components could not be rendered and the application would not run.

This limits the flexibility during the development process: data sources are required for creating the databound user interface. Without them, no meaningful user interfacer can be created.

With 11g, a new type of data control is introduced: the Placeholder Data Control. Placeholder Data Controls are the stand-ins for real data controls. They can be used when the real data control and its underlying data source are not yet available or the application is temporarily off line without access to the database or web services that underpin the model. Placeholder Data Controls allow the creation of a data bound user interface in the absense of the data sources. They UI designers/web specialists to create a functional application with meaningful data and working navigation without knowledge of the business services.

Creation of a Placeholder Data Control and its Data Types is a simple task – and using them is even simpler:....

– create a new Placeholder Data control – specify a name
– create a Data Type under this Data Control – specify a name, the attributes and sample data (rows of data that will be displayed when the application is run with the placeholder data control still in place)
– optional: create additional Data Types (note: data types can have a master detail relationship with other data types)

The Placeholder Data Control is visible in the DataControl palette and can be used (drag & drop, bind to components) just like any other data control. From the perspective of the ADF Faces components, it is no different from other data controls.

Let take a quick look at these steps:
– start JDeveloper, create/open an Application, Create/Open a project
– from the New Gallery, Under Business Tier, node Data Controls, select Placeholder Data Control

ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc001 

– enter the name and optionally a description

 ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc002

– data control is displayed in the dc palette.

ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc003
– from the context menu on the data control, select the option to create a data type

ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc004
– specify name, attributes, types, label etc.

ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc005
– go to sample data tab; enter rows of data
ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc006

In the Data Control Palette, you will now find the Data Type under the Placeholder Data Control .

ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc008 

Now you are ready to use the placeholder data control in your pages. Create a new JSF page or open an existing one. Drag and drop the Person node under the MyPeoplePlaceholder to the JSF page:

ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc013 

Select ADF Read Only Table. Edit the Table Columns in the aptly named popup:

ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc010

 Press OK. The page is displayed, with the data from the Person Data Type already displayed in the visual editor:

ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc014

Now you can run the page – to see what this offline ADF application without any proper data control looks like:

ADF 11g Placeholder Data Control - for off line demonstration of application and/or rapid UI prototyping without a need for a business service placeholderdc012

 

There seems to be an issue with the Birthdate column: the display format for Date Column is not correct, even though the display format was set to SimpleDate – dd-MM-yyyy. Maybe this format was not applied to the sample data as well. The format with which the sample data should have been entered is probably different from the dd-MM-yyyy format. Also note that in the current build of JDeveloper 11g I had an issue with ADF (editable) Table – dropping the Placeholder Data Control’s Person Data Type on the JSF page as an ADF (Editable) Table resulted in the strange phenomenon that in the browser (when running the page) three rows are visible – but no data is shown. So I can tell the table contains three records, but none of the cell values are visible.

Summary

The Placeholder Data Control is very easy to use. It gives us the opportunity to create (prototype) a User Interface in the absence of real underlying data sources. It also allows us to create demo-applications, samples and training exercises without the need for a database or other backend service.

In a other articles we will take a closer look at:

– creating Data Types from CSV files with sample data

– establishing master detail relationships between data types

– creating (project wide) reusable Placeholder Data Controls

– rebinding ADF components – replacing binding to a Placeholder Data Control with binding to an actual Data Control.

2 Comments

  1. Lucas Jellema September 21, 2008
  2. Edwin Biemond September 21, 2008