Create Data Entry OAF Page
Create Data Entry OAF Page
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
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
vo.executeQuery();
}
if (!pageContext.isFormSubmission())
{
OAApplicationModule am =
pageContext.getApplicationModule(webBean);
am.invokeMethod("createRecord", null);
}
}
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");
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
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);
9. Select the SearchPG and go to the strcuture pane where a default region has
been created
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
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
Note - The property Scope is the key property which makes the
LOV region public and makes it usable in multiple pages
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
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
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}
4. Select the UpdatePG and go to the strcuture pane where a default region
has been created
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
Attribute Property
ID Column1
Style Property messageTextInput
Prompt Column1
Data Type VARCHAR2
Length 20
Maximum Length 100
View Instance SearchVO1
View Attribute Column1
Attribute Property
ID Column2
Style Property messageTextInput
Prompt Column2
Data Type VARCHAR2
Length 20
Maximum Length 100
View Instance SearchVO1
View Attribute Column2
Attribute Property
Region ButtonLayout
Attribute Property
ID Apply
Item Style submitButton
Attribute /oracle/apps/fnd/attributesets/Buttons/Ap
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);
}
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);
}
}
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
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
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);
}
8. Congratulation you have successfully finished. Run Your page and Test Your
Work