Executing Business Service Methods with a Data Action

You can use the Data Control Palette to add methods to data actions of your databound Struts page flow. The data action executes the method defined by the business service through the Oracle ADF data controls.

Note: The Data Control Palette may appear empty when you first open it. Follow the procedure below to populate the palette with business services from your model project.

To populate the Data Control Palette with business services:

  1. Define the business services that you want your Oracle ADF application to access. The business services appear in your model project.

  2. Create ADF data controls in your model project to register the business services. If the Data Control Palette is already open, the business services hierarchy appears in the top portion of the palette.

To add a business service operation to a data action:

  1. Display the page flow in the Struts Page Flow Diagram.

  2. Choose View | Data Control Palette to open the palette.

  3. Expand the Data Control Palette hierarchy.

    The Data Control Palette displays two types of operations:

  4. Select the desired action from the Operations folder at either the root level or in a data collection and select Method (the only selection choice) in the dropdown list. For example, a palette selection to add a create action would look similar to this (although the names of your data collections, attributes, and operations will differ):

    Data Control Palette with top level operations

  5. Add the method into your page flow by dragging the selection from the Data Control Palette onto the data action. The design time updates the action mapping for the data action like this:

    <set-property property="methodName" value="MyPageUIModel.ActionName"/>
    <set-property property="resultLocation" value="${requestScope.methodResult}"/>
    <set-property property="numParams" value="1"/>
    <set-property property="paramNames[0]" value="${param.paramName0}"/>

    Note: There is a paramNames[] property for each method parameter. If the method has no parameters, the value of numParams is set to 0 and there are no paramNames properties set. If you are using a custom method that requires parameters, you must add the paramNames properties using the Struts Configuration Editor. For an example of a scenario that uses a custom method with parameters, see Using a Custom Method to Set the Bind Parameters in a View Object

You can continue to add additional methods to the data actions of your page flow.


You can customize the properties of the data binding objects at design time:

You can use the Visual Editor to arrange the UI components you added.

 

Copyright © 1997, 2004, Oracle. All rights reserved.