Vous êtes sur la page 1sur 3

Orders: Update

Make a Copy of Your OrderCreatePG

For the most part, a single page update and insert page are identical. Since you already created an
insert page, the quickest way to implement a new corresponding update page with the same items
and underlying view object is to simply copy the page definition and then make any necessary
Note:We are using the page copy technique shown here to avoid having you recreate a page that
is virtually identical to one that you have already created. When developing a real product,
however, pages that are this similar should be implemented as a single page with a dynamic user

Copy OrderCreatePG on the File System

Since the JDeveloper OA Extension does not yet support the ability to "save as" or copy/paste a
page document, you need to use the file system for the following task.
Save all your work and close JDeveloper.
Select your OrderCreatePG.xml document in the Windows Explorer, right-click
and select Copy.
Select the webui directory node, right-click and select Paste. Your new file will be
namedCopy of OrderCreatePG.
Select the new file in the Explorer, right-click and select Rename. Change the name
to OrderUpdatePG.
Start JDeveloper, expand the OA Components category in your project, and select
the Add File toolbar icon to open the Add Files or Directories to <your project
name> dialog. Locate your OrderUpdatePG and select OK to add this file to your
Copy and Change the Create Page Controller
We need to change the controller associated with your new update page.
Open your OrderCreateCO controller in JDeveloper and select File > Save As
from the main menu. Name your new file OrderUpdateCO.
Change the class name in your newOrderCreateCO file to OrderUpdateCO.
Tip: If you forgot to change class name to match the file name and you recompile, you will get a
warning like this: Warning(28,8): class OrderCreateCO is public; should be declared in a file
named OrderCreateCO.java; or the class should be renamed to OrderDescriptionCO to match the
Select the OrderUpdatePG page's PageLayoutRN region in the JDeveloper
structure pane to open the property inspector.
Change its Controller Class property value from
<yourname>.oracle.apps.demxx.orderentry.webui.OrderCreateCO to

Change its Title property value to Update Order.
Now make a few modifications on the update page as described
Select the MainRN, choose the DateOrdered item from RowOneRN in RowOneLayout.
Set the Read Only property to True (as Order Date should be update-disallowed).

Add an Update Column to the Search Page

In this task, you will add an Update image column to your Orders Results table
Add the "Update" Column to the Results Table
Note that the Update icon should be declaratively configured to perform a form submit when
Select the ResultsTable in the Structure pane, right-click and select New > Item from context
Configure this item's properties as follows:
Property Value
Item Style
Attribute Set
Image URL
Action Type
Place your cursor in the Parameters property field and select the list of values "..." button.
In the Parameters window, define a parameter whose name is ordNum and whose
value is ${oa.OrderSearchVO.OrderId}.
Select the Add Parameters button and define a second parameter whose name is
custName and whose value is ${oa. OrderSearchVO.CustomerName}.
Select the OK button to create your request parameters.

Modify the OrderSearchCO Controller

Add code to your processFormRequest() method to determine if the Update icon is selected.
if ("update".equals(pageContext.getParameter(EVENT_PARAM)))
// The user has clicked an "Update" icon so we want to navigate
// to the first step of the multistep "Update Order" flow.

true, // Retain AM

Modify the OrderUpdateCO Controller

Now you need to change the logic in the OrderUpdateCO controller to properly support the
update action and page flow.
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
String ordNum = pageContext.getParameter("ordNum");
// We'll use this at the end of the flow for a confirmation message.
String custName = pageContext.getParameter("custName");
pageContext.putTransactionValue("custName", custName);
Serializable[] params = { ordNum };
OAApplicationModule am = pageContext.getApplicationModule(webBean);
// For the update, since we're using the same VO as the "Details" page, we
// can use the same initialization logic.
am.invokeMethod("initDetails", params);
OAMessageRadioButtonBean rb1 =
OAMessageRadioButtonBean rb2 =
OAMessageRadioButtonBean rb3 =
// To initialise your PPR components
} // end processRequest

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)

If(pageContext.getParameter(Apply)!= null)