ADF Sample Applications
In my daily work, I often create small example applications for customers. I'll document them here - for those who read Steve's blog regularly, I copied the idea from his "Not Yet Documented ADF Sample Applications" page.
When I find useful to document the example in detail, you'll find a project "_StartHere" in the application. Right-click _StartHere and select Run to see the associated Help page:
- Rendered
[10.1.3.3.0] 30-APR-08
Shows an ADF Faces page with 2 radio buttons to show / hide a command button.
This doesn't work when both properties rendered and partialTriggers are defined on the button.
It works fine when wrapping the button in a parent component where you move the partialTriggers property.
For more information, see "Only Rendered ADF Faces Components Can React To PPR" - Lookup
[10.1.3.3.0] 31-JAN-08
Shows an ADF Faces page displaying an Employee (SCOTT.EMP); it includes a field Deptno that automatically refreshes a field Dname (called a "Lookup" field by the Oracle Forms and Oracle Designer community).
The underlying model is a View Object EmpView based on 2 Entity Objects Emp (Primary and Updatable Entity Object) and Dept (Reference Entity Usage).
The Deptno is bound to an <af:selectInputText> component with property autoSubmit="true", causing a PPR (Partial Page Rendering) postback to occur when the end-user changes the value of the Deptno.
The Dname field has its partialTriggers property set to the value of the id of the <af:selectInputText> component (partialTriggers="Deptno"). As result, its value is refreshed as soon as the value of Deptno is changed. - <af:tableSelectMany>
[10.1.3.2.0]
Shows
an ADF Faces page where you can select many Employees to increase their
salary.
This sample doesn't include any code, except in the
Application Module to increase the salary. The rest is
declarative!
The method in the AM has the following signature:
public void massSalaryIncrease
(Set<Key> EmpKeys, Number raise)
In
the method binding, I pass the following EL as parameter: ${requestScope.BackingSalaryIncrease.selectedEmployees.selectionState.keySet}
This
will pass the Keys of the selected employees to the AM method. There
it's possible to loop through the keys to process the records, by
selecting them with the findByKey()
method. - TableRange [10.1.3.1.0]
Shows
an ADF Faces page where you can query the Employees (Read-Only Table)
of a specific Department (by entering the Department Number). The case
is trivial, but end-users may report a strange behavior:
the Range in the Table stays at the same position as previously selected.
F.ex.
you query the Employees from Department 10, navigate to the second
Range of Employees, and then query the Employees from another
Department, say 20. While you would expect the page to show the first
Range, with the first Employees from the Department 20, it doesn't:
the page stays at the same Range (second) as it was when displaying Employees from Department 10.
The
sample includes a page showing the default behavior and another one
with a workaround, where I reset the Range to the first row of the
table [table.setFirst(0)]. - <af:selectBooleanCheckbox> [10.1.3]
Shows how to use an <af:selectBooleanCheckbox> bound to VARCHAR2 or NUMBER Oracle Database columns.
This
is performed by creating a transient attribute of type Boolean and
redefining its getter and setter methods to 'translate' the ADF
Business Components type Boolean to 'standard' String or Number types that Oracle "understands".
(Boolean
is not a valid type in the Oracle Database). - ENTER key and Reset button
Shows how to set an ADF Faces page to Submit the form with the ENTER key
It also shows how to reset the fields to null with a Reset button, via JavaScript. - <af:selectOneRadio>
Shows how to disable/enable inputTexts depending on the value selected in a Radio Group (selectOneRadio); this example illustrates the following properties: AutoSubmit, PartialTriggers & EL in the "Disabled" property.


















