If you are using the Page Flow Diagram to add an action that forwards either to another action or directly to a databound web page, you can add a data action.
When you want to work with Oracle ADF data controls to create databound
client applications, you will use the Oracle ADF class
oracle.adf.controller.struts.actions.DataAction
. This is the
first step to create the action mappings for your page flow. At runtime,
an Oracle ADF data action instance prepares the data for the web page to
render.
To create a data action:
If your project does not already contain the WEB-INF folder with the
struts-config.xml
file,
add Struts support to your project and open the Struts Page Flow Diagram.
Open the Struts Page Flow Diagram and display the Component Palette.
Select Data Action in the Component Palette.
In the empty page flow diagram, click anywhere to insert the new data action.
The icon you insert into the Page Flow Diagram diagram will appear with a yellow warning icon overlaid. This indicates that you have not yet defined the data action class name. You can define the data action class by double-clicking to display the definition dialog. After this, the icon will appear without the warning overlay.
Click the label of the /dataAction1 icon
in the diagram and edit the name. For example, you might name the
action that initiates your web application /MainDataAction
.
Note: Do not double-click the new data action
element in the page flow diagram. This will display a dialog that
lets you subclass the
oracle.adf.controller.struts.actions.DataAction
class. If you
display the dialog, click Cancel to exit
without creating a subclass.
The struts-config.xml
file is updated with the definition
for the action:
<action path="/MyMainDataAction"
className="oracle.adf.controller.struts.actions.DataActionMapping"
type="oracle.adf.controller.struts.actions.DataAction" name="DataForm"/>
Although the class DataAction.java
does not appear in your
client project, you can view its source code by right-clicking the data
action element in the page flow diagram and pressing
Ctrl and - (minus key). This data action
class calls request.setAttribute("bindings", bindings);
to publish the Oracle ADF binding context on the HTTP Request object and make
it available to the databound page at runtime.
Before you can run an Oracle ADF data action from the page flow diagram,
you must first create a page forward to set the Oracle ADF model
reference on the action class.
Choosing a Page Design Approach for the Struts Page Flow Diagram
Defining a Data Action Forward in
the Page Flow Diagram
Adding a
Navigation Link to the Page Flow Diagram
Subclassing a Data Action or Data Forward Action (Data Page) for Multiple
Forward Results
Copyright © 1997, 2004, Oracle. All rights reserved.