Sei sulla pagina 1di 33

Create Data Entry OAF

Page
By: Guest Author
1. Create a New Workspace and Project
Right click Workspaces and click create new OAworkspace and
name it as PRajkumarInsert. Automatically a new OA Project is also
created. Name the project as InsertDemo and package as
prajkumar.oracle.apps.fnd.insertdemo

2. Create a New Application Module (AM)


Right Click on InsertDemo > New > ADF Business Components >
Application Module
Name -- InsertAM
Package -- prajkumar.oracle.apps.fnd.insertdemo.server

3. Enable Passivation for the Root UI Application Module (AM)


Right Click on InsertAM > Edit InsertAM > Custom Properties >
Name RETENTION_LEVEL
Value MANAGE_STATE
Click add > Apply > OK

4. Create Test Table in which we will insert data (For Testing


Purpose)
CREATE TABLE xx_insert_demo
( -- ---------------------
-- Data Columns
-- ---------------------
column1 VARCHAR2(100),
column2 VARCHAR2(100),
-- ---------------------
-- Who Columns
-- ---------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);

5. Create a New Entity Object (EO)


Right click on InsertDemo > New > ADF Business Components >
Entity Object
Name InsertEO
Package -- prajkumar.oracle.apps.fnd.insertdemo.schema.server
Database Objects -- XX_INSERT_DEMO

Note By default ROWID will be the primary key if we will not make
any column to be primary key.
Check the Accessors, Create Method, Validation Method and
Remove Method

6. Create a New View Object (VO)


Right click on InsertDemo > New > ADF Business Components >
View Object
Name -- InsertVO
Package -- prajkumar.oracle.apps.fnd.insertdemo.server
In Step2 in Entity Page select InsertEO and shuttle them to selected
list
In Step3 in Attributes Window select columns Column1, Column2
and shuttle them to selected list
In Java page deselect Generate Java file for View Object Class:
InsertVOImpl and Select Generate Java File for View Row Class:
InsertVORowImpl

7. Add Your View Object to Root UI Application Module


Right click on InsertAM > Edit InsertAM > Data Model >
Select InsertVO in Available View Objects list and shuttle to Data
Model list
8. Create a New Page
Right click on InsertDemo > New > Web Tier > OA Components >
Page
Name -- InsertPG
Package -- prajkumar.oracle.apps.fnd.insertdemo.webui

9. Select the InsertPG and go to the strcuture pane where a


default region has been created

10. Select region1 and set the following properties:


ID -- PageLayoutRN
Region Style -- PageLayout
AM Definition --
prajkumar.oracle.apps.fnd.insertdemo.server.InsertAM
Window Title -- Date Entry Page Window
Title -- Data Entry Page
Auto Footer -- True

11. Right click PageLayoutRN > New > Region


ID -- MainRN
Region Style -- defaultSingleColumn

12. Create Text Input Items


Right click on MainRN > New > Item
Set following properties for New Item
ID -- COLUMN1
Item Style -- messageTextInput
Maximum Length -- 100
Length -- 20
Prompt -- Column1
View Instance -- InsertVO1
View Attribute -- Column1

Again Right click on MainRN > New > Item


Set following properties for New Item
ID -- COLUMN2
Item Style -- messageTextInput
Maximum Length -- 100
Length -- 20
Prompt -- Column2
View Instance -- InsertVO1
View Attribute Column2

13. Add Apply and Cancel Buttons


Right click on PageLayoutRN > New > Region
ID -- PageButtons
Region Style -- pageButtonBar

Right click on PageButtons > New > Item


ID -- Cancel
Item Style -- submitButton
Attribute Set -- /oracle/apps/fnd/attributesets/Buttons/Cancel
Disable Server Side Validation -- True
Prompt -- Cancel
Warm About Changes -- False
Additional Text Select to cancel this transaction.

Right click on PageButtons > New > Item


ID -- Apply
Item Style -- submitButton
Attribute Set -- /oracle/apps/fnd/attributesets/Buttons/Apply
Prompt -- Apply
Additional Text Select to save this transaction.

14. Implement Row Initialization (Create a View Object Row)


Add createRecord method to your InsertAMImpl class
import oracle.jbo.Row;
import oracle.apps.fnd.framework.OAViewObject;
...

public void createRecord()


{
OAViewObject vo = (OAViewObject)getInsertVO1();
if (!vo.isPreparedForExecution())
{

vo.executeQuery();
}

Row row = vo.createRow();


vo.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
}

15. Create Controller for Page


PageLayoutRN > Set New Controller >
Package Name: prajkumar.oracle.apps.fnd.insertdemo.webui
Class Name: InsertCO

16. Add Create Page Initialization to your Controller


Add following code to your processRequest()
import oracle.apps.fnd.framework.OAApplicationModule;
...

public void processRequest(OAPageContext


pageContext,OAWebBean webBean)
{
super.processRequest(pageContext, webBean);

if (!pageContext.isFormSubmission())
{
OAApplicationModule am =
pageContext.getApplicationModule(webBean);
am.invokeMethod("createRecord", null);
}
}

17. Add below method in InsertAMImpl Class to handle


Apply Button action
import oracle.jbo.Transaction;
...

public void apply()


{
getTransaction().commit();
}

18. Add below Logic in InsertCO to handle Apply Button


Add following code to your processFormRequest()
import oracle.jbo.domain.Number;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import
oracle.apps.fnd.framework.webui.OAWebBeanConstants;
...
public void processFormRequest(OAPageContext pageContext,
OAWebBean webBean)
{super.processFormRequest(pageContext, webBean);
OAApplicationModule am =
pageContext.getApplicationModule(webBean);
// Pressing the "Apply" button means the transaction
should be
// validated and committed.

if (pageContext.getParameter("Apply") != null)
{
OAViewObject vo =
(OAViewObject)am.findViewObject("InsertVO1");
String column1 =
(String)vo.getCurrentRow().getAttribute("Column1");
String column2 =
(String)vo.getCurrentRow().getAttribute("Column2");

am.invokeMethod("apply");

// Create a FND Message with name "TEST_CREATE_CONFIRM"


with two
// tokens
MessageToken[] tokens = { new MessageToken("COLUMN1",
column1),
new MessageToken("COLUMN2",
column2)
};

OAException confirmMessage = new OAException( "FND",


"TEST_CREATE_CONFIRM",
tokens,

OAException.CONFIRMATION, null);

pageContext.putDialogMessage(confirmMessage);
pageContext.forwardImmediately(
"OA.jsp?
page=/prajkumar/oracle/apps/fnd/insertdemo/webui/InsertPG
",
null, OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}
}
19. Congratulations you have successfully created data insert
page. Run InsertPG page to test Your Work
Create OAF Search Page
By: Guest Author
1. Create a New Workspace and Project
Right click Workspaces and click create new OAworkspace and name it as
PRajkumarSearch. Automatically a new OA Project is also created. Name the project
as SearchDemo and package as prajkumar.oracle.apps.fnd.searchdemo

2. Create a New Application Module (AM)


Right Click on SearchDemo > New > ADF Business Components > Application
Module
Name -- SearchAM
Package -- prajkumar.oracle.apps.fnd.searchdemo.server

3. Enable Passivation for the Root UI Application Module (AM)


Right Click on SearchAM > Edit SearchAM > Custom Properties >
Name RETENTION_LEVEL
Value MANAGE_STATE
Click add > Apply > OK

4. Create Test Table and insert data some data in it (For Testing Purpose)
CREATE TABLE xx_search_demo
( -- --------------------
-- Data Columns
-- --------------------
column1 VARCHAR2(100),
column2 VARCHAR2(100),
-- --------------------
-- Who Columns
-- --------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);
INSERT INTO xx_search_demo VALUES (val1, val2, SYSDATE, 0, SYSDATE, 0,
0);
INSERT INTO xx_search_demo VALUES (val1, val2, SYSDATE, 0, SYSDATE, 0,
0);
INSERT INTO xx_search_demo VALUES (val3, val4, SYSDATE, 0, SYSDATE, 0,
0);
INSERT INTO xx_search_demo VALUES (val5, val6, SYSDATE, 0, SYSDATE, 0,
0);

Now we have 4 records in our custom table

5. Create a New Entity Object (EO)


Right click on SearchDemo > New > ADF Business Components > Entity Object
Name SearchEO
Package -- prajkumar.oracle.apps.fnd.searchdemo.schema.server
Database Objects -- XX_SEARCH_DEMO
Note By default ROWID will be the primary key if we will not make any column to
be primary key Check the Accessors, Create Method, Validation Method and
Remove Method

6. Create a New View Object (VO)


Right click on SearchDemo > New > ADF Business Components > View Object
Name -- SearchVO
Package -- prajkumar.oracle.apps.fnd.searchdemo.server
In Step2 in Entity Page select SearchEO and shuttle them to selected list
In Step3 in Attributes Window select columns Column1, Column2 and shuttle them to
selected list
In Java page Select Generate Java file for View Object Class: SearchVOImpl
and Generate Java File for View Row Class: SearchVORowImpl

7. Add Your View Object to Root UI Application Module


Select Right click on SearchAM > Edit SearchAM > Data Model >
Select SearchVO and shuttle to Data Model list

8. Create a New Page


Right click on SearchDemo > New > Web Tier > OA Components > Page
Name -- SearchPG
Package -- prajkumar.oracle.apps.fnd.searchdemo.webui

9. Select the SearchPG and go to the strcuture pane where a default region has
been created

10. Select region1 and set the following properties:


ID -- PageLayoutRN
Region Style -- PageLayout
AM Definition -- prajkumar.oracle.apps.fnd.searchdemo.server.SearchAM
Window Title -- Search Page Window
Title -- Search Page
Auto Footer -- True

11. Add a Query Bean to Your Page


Right click on PageLayoutRN > New > Region
Select new region region1 and set following properties
ID QueryRN
Region Style query
Construction Mode resultBasedSearch
Include Simple Panel True
Include Views Panel True
Include Advanced Panel True

12. Add a Result Data Table to your QueryRN


Select QueryRN right click > New > Region using Wizard
In BC4J Objects page, Select your SearchAM and then select your SearchVO1

Note DO NOT select Use this as Application Module Definition for this
region checkbox
In Region Properties page, set Region ID value to ResultsTable and Region
Style to table
In view Attributes page, select attributes from Available View Attributes list and
shuttle them to
Selected View Atributes list:
Column1
Column2
In Region Items Page, you can set ID, Style and Attributes Set. Currently we are
going to set only Style as messageStyledText

13. Set and verify Your Results Table Region Properties


ID ResultsTable
Region Style table
AM Please Donot put any AM
Rendered True
Records Displayed 10
Width 100%
User Personalization True

14. Set or Verify Column1 Item Properties


Search Allowed -- True
Sort Allowed ascending
Initial Sort Seqence first
Selective Search Criteria True
User Personalization True

15. Set or Verify Column2 Item Properties


Search Allowed True
Sort Allowed -- ascending
Selective Search Criteria True
User Personalization True

16. Congratulation you have successfully finished Search page. Run Your
SearchPG page and Test Your Work
Implement External LOV in
OA Framework
By: Guest Author
1. Create a New Workspace and Project
Right click Workspaces and click create new OAworkspace and
name it as PRajkumarLovDemo. Automatically a new OA Project is
also created. Name the project as LovDemo and package as
prajkumar.oracle.apps.fnd.lovdemo

2. Create a New Application Module (AM)


Right Click on LovDemo > New > ADF Business Components >
Application Module
Name -- LovAM
Package -- prajkumar.oracle.apps.fnd.lovdemo.server

3. Create a New View Object (VO)


Right click on LovDemo > New > ADF Business Components >
View Object
Name -- LovVO
Package -- prajkumar.oracle.apps.fnd.lovdemo.server

Note - The VO is not based on any EO so click next and go to the


query section and paste the query
SELECT employee_number, full_name
FROM per_all_people_f
WHERE SYSDATE BETWEEN effective_start_date AND
effective_end_date

4. Add View Object to Root UI Application Module

5. Create a New Page


Right click on LovDemo > New > Web Tier > OA Components >
Page
Name -- LovPG
Package -- prajkumar.oracle.apps.fnd.lovdemo.webui

6. Select the LovPG and go to the strcuture pane where a


default region has been created

7. Select region1 and set the following properties:


ID -- PageLayoutRN
AM Definition -- prajkumar.oracle.apps.fnd.lovdemo.server.LovAM
Window Title -- List of values Demo Window
Title List of values Demo

8. Right click PageLayoutRN and click new Region


ID -- MainRN
Region Style messageComponentLayout
Note - Style is given as messageComponentlayout because we are
going to create only message components that is messageLovInput
item in that region

9. Create a New Region


Right click on LovDemo > New > Web Tier > OA Components >
Region
Name -- EmployeeLovRN
Package -- prajkumar.oracle.apps.fnd.lovdemo.webui
Region Style -- listOfValues
Scope -- Public

Note - The property Scope is the key property which makes the
LOV region public and makes it usable in multiple pages

10. Select EmployeeLovRN. Right click on EmployeeLovRN in


Structure pane and click table using wizard. In the wizard
choose the prajkumar.oracle.apps.fnd.lovdemo.server.LovAM
and select the LovVO1. Click Next
Region Id -- LovRN
Region style -- table
11. Shuttle the two attributes to the right side.That is
EmployeeNumber and FullName

12. Click next, check the mapping and then finish

13. Select the field FullName and set the following properties:
Search Allowed -- True
Selective Search Criteria True

Note - The first property lets users search on these values in the
LOV, and the second property ensures that the users specify
search criteria for at least one of these values to avoid a blind query

Attaching External LOV to Page:

14. Click on LovPG and right click the MainRN and click new
messageLovInput
External Lov --
/prajkumar/oracle/apps/fnd/lovdemo/webui/EmployeeLovRN
Lov Region Item -- FullName
Return Item -- item1
Criteria Item -- item1
Prompt -- Employee Name

15. Congratulation you have successfully finished. Run Your


page and Test Your Work
Update records in OAF Page
By: Guest Author
1. Create a Search Page to Create a page please go through the following link
https://blogs.oracle.com/prajkumar/entry/create_oaf_search_page

2. Implement Update Action in SearchPG


Right click on ResultTable in SearchPG > New > Item

Set following properties for New Item

Attribute Property
ID UpdateAction
Item Style image
Image URI updateicon_enabled.gif
Atribute Set /oracle/apps/fnd/attributesets/Buttons/Upda
Prompt Update
Additional Text Update record
Height 24
Width 24
Action Type fireAction
Event update
Submit True
Parameters Name PColumn1
Value -- ${oa.SearchVO1.Column1}
Name PColumn2
Value -- ${oa.SearchVO1.Column2}

3. Create a Update Page


Right click on SearchDemo > New > Web Tier > OA Components > Page
Name UpdatePG
Package prajkumar.oracle.apps.fnd.searchdemo.webui

4. Select the UpdatePG and go to the strcuture pane where a default region
has been created

5. Select region1 and set the following properties:

Attribute Property
ID PageLayoutRN
Region Style PageLayout
AM Definition prajkumar.oracle.apps.fnd.searchdemo.server.SearchA
Window Title Update Page Window
Title Update Page
Auto Footer True

6. Create the Second Region (Main Content Region)


Select PageLayoutRN right click > New > Region
ID MainRN
Region Style messageComponentLayout

7. Create first Item (Empty Field)


MainRN > New > messageTextInput

Attribute Property
ID Column1
Style Property messageTextInput
Prompt Column1
Data Type VARCHAR2
Length 20
Maximum Length 100
View Instance SearchVO1
View Attribute Column1

8. Create second Item (Empty Field)


MainRN > New > messageTextInput

Attribute Property
ID Column2
Style Property messageTextInput
Prompt Column2
Data Type VARCHAR2
Length 20
Maximum Length 100
View Instance SearchVO1
View Attribute Column2

9. Create a container Region for Apply and Cancel Button in UpdatePG


Select MainRN of UpdatePG
MainRN > messageLayout

Attribute Property
Region ButtonLayout

10. Create Apply Button


Select ButtonLayout > New > Item

Attribute Property
ID Apply
Item Style submitButton
Attribute /oracle/apps/fnd/attributesets/Buttons/Ap

11. Create Cancel Button


Select ButtonLayout > New > Item
Attribute Property
ID Cancel
Item Style submitButton
Attribute /oracle/apps/fnd/attributesets/Buttons/Ca

12. Add Page Controller for SearchPG


Right Click on PageLayoutRN of SearchPG > Set New Controller
Name SearchCO
Package -- prajkumar.oracle.apps.fnd.searchdemo.webui

Add Following code in Search Page controller SearchCO

import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.layout.OAQueryBean;
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAQueryBean queryBean =
(OAQueryBean)webBean.findChildRecursive("QueryRN");
queryBean.clearSearchPersistenceCache(pageContext);
}

public void processFormRequest(OAPageContext pageContext, OAWebBean


webBean)
{
super.processFormRequest(pageContext, webBean);

if ("update".equals(pageContext.getParameter(EVENT_PARAM)))
{
pageContext.setForwardURL("OA.jsp?
page=/prajkumar/oracle/apps/fnd/searchdemo/webui/UpdatePG",
null,

OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
OAWebBeanConstants.IGNORE_MESSAGES);
}
}
13. Add Page Controller for UpdatePG
Right Click on PageLayoutRN of UpdatePG > Set New Controller
Name UpdateCO
Package -- prajkumar.oracle.apps.fnd.searchdemo.webui
Add Following code in Update Page controller UpdateCO

import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.OAApplicationModule;
import java.io.Serializable;
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
String Column1 = pageContext.getParameter("PColumn1");
String Column2 = pageContext.getParameter("PColumn2");
Serializable[] params = { Column1, Column2 };
am.invokeMethod("updateRow", params);
}
public void processFormRequest(OAPageContext pageContext, OAWebBean
webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);

if (pageContext.getParameter("Apply") != null)
{
am.invokeMethod("apply");
pageContext.forwardImmediately("OA.jsp?
page=/prajkumar/oracle/apps/fnd/searchdemo/webui/SearchPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
false, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}
else if (pageContext.getParameter("Cancel") != null)
{
am.invokeMethod("rollback");
pageContext.forwardImmediately("OA.jsp?
page=/prajkumar/oracle/apps/fnd/searchdemo/webui/SearchPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
false, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}
}

14. Add following Code in SearchAMImpl


import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;

public void updateRow(String Column1, String Column2)


{
SearchVOImpl vo = (SearchVOImpl)getSearchVO1();
vo.initQuery(Column1, Column2);
}

public void apply()


{
getTransaction().commit();
}
public void rollback()
{
getTransaction().rollback();
}

15. Add following Code in SearchVOImpl

import oracle.apps.fnd.framework.server.OAViewObjectImpl;

public void initQuery(String Column1, String Column2)


{
if ((Column1 != null) && (!("".equals(Column1.trim()))))
{
setWhereClause("column1 = :1 AND column2 = :2");
setWhereClauseParams(null); // Always reset
setWhereClauseParam(0, Column1);
setWhereClauseParam(1, Column2);
executeQuery();
}
}

16. Congratulation you have successfully finished. Run Your Search page and
Test Your Work
Delete Records in OAF Page
By: Guest Author
1. Create a Search Page to Create a page please go through the following link
https://blogs.oracle.com/prajkumar/entry/create_oaf_search_page

2. Implement a Delete in your SearchEOImpl Class


public void remove()
{ super.remove();
} // end remove()

3. Create a Delete Image


Select ResultsTable right click > New > Item
Set following properties for New Item
ID DeleteAction
Item Style image
Image URI deleteicon_enabled.gif
Atribute Set -- /oracle/apps/fnd/attributesets/Buttons/Delete
Prompt -- Delete
Additional Text Delete record action enabled
Height 24
Width 24
Action Type fireAction
Event delete
Submit True
Select Parameter Properties define parameter name as Column1 and whose value is
${oa.SearchVO1.Column1}
Select Parameter Properties define parameter name as Column2 and whose value is
${oa.SearchVO1.Column2}
Select OK button to create your request parameters

4. Add Page Controller


Add a New Contoller for SearchPG
Name SearchCO
Package -- prajkumar.oracle.apps.fnd.searchdemo.webui

Implement Delete Action


5. Add deleteRecord() method to SearchAMImpl
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.jbo.domain.Number;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
import oracle.jbo.RowSetIterator;
...
public void deleteRecord(String Column1)
{ OAViewObject vo = (OAViewObject)getSearchVO1();
SearchVORowImpl row = null;
int fetchedRowCount = vo.getFetchedRowCount();
RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
if (fetchedRowCount > 0)
{ deleteIter.setRangeStart(0);
deleteIter.setRangeSize(fetchedRowCount);
for (int i = 0; i < fetchedRowCount; i++)
{
row = (SearchVORowImpl)deleteIter.getRowAtRangeIndex(i);
row.remove();
getTransaction().commit();
break;
}
}
deleteIter.closeRowSetIterator();
} // end deleteRecord

Note Create Standard FND Messages DELETE_RECORD_WARN and


DELETE_CONFIRM
6. Add DeleteSelection Handler Code to SearchCO.processFormRequest()
import com.sun.java.util.collections.HashMap;
import oracle.apps.fnd.framework.webui.OADialogPage;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.OARow;
import oracle.apps.fnd.framework.OAApplicationModule;
...
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject vo =(OAViewObject)am.findViewObject("SearchVO1");
String rowRef =
pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFE
RENCE);
OARow row = (OARow)am.findRowByRef(rowRef);
if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
{
String Column1 = (String)row.getAttribute("Column1");
String Column2 = (String)row.getAttribute("Column2");
String Column3 = pageContext.getParameter("Column1");
String Column4 = pageContext.getParameter("Column2");
MessageToken[] tokens = { new MessageToken("COLUMN1", Column1),
new MessageToken("COLUMN2", Column2)};

OAException mainMessage = new OAException("FND",


"DELETE_RECORD_WARN", tokens);
OADialogPage dialogPage = new OADialogPage(OAException.WARNING,
mainMessage, null, "", "");
String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);

dialogPage.setOkButtonItemName("DeleteYesButton");
dialogPage.setOkButtonToPost(true);
dialogPage.setNoButtonToPost(true);
dialogPage.setPostToCallingPage(true);

dialogPage.setOkButtonLabel(yes);
dialogPage.setNoButtonLabel(no);
java.util.Hashtable formParams = new java.util.Hashtable(1);
formParams.put("Column1", Column3);
formParams.put("Column2", Column4);
dialogPage.setFormParameters(formParams);

pageContext.redirectToDialogPage(dialogPage);
}

7. Add Delete Confirmation Handler Code to SearchCO.processFormRequest()


import java.io.Serializable;
import oracle.apps.fnd.framework.OAApplicationModule;
...
else if (pageContext.getParameter("DeleteYesButton") != null)
{
String Column1 = (String)row.getAttribute("Column1");
String Column2 = (String)row.getAttribute("Column2");
Serializable[] parameters = { Column1 };
OAApplicationModule am =
pageContext.getApplicationModule(webBean);
am.invokeMethod("deleteRecord", parameters);
OAException message = new OAException("FND",
"DELETE_CONFIRM", null,
OAException.CONFIRMATION, null);
pageContext.putDialogMessage(message);
}

8. Congratulation you have successfully finished. Run Your page and Test Your
Work

Potrebbero piacerti anche