Sie sind auf Seite 1von 12

10/2/2017 Update records in OAF Page | Welcome to My Oracle World

Categories

Welcome to My Oracle World

Wednesday, June 27, 2012

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

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 1/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

Item Style image

Image URI updateicon_enabled.gif

Atribute Set /oracle/apps/fnd/attributesets/Buttons/Update

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

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 2/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

5. Select region1 and set the following properties:

Attribute Property

ID PageLayoutRN

Region Style PageLayout

AM Definition prajkumar.oracle.apps.fnd.searchdemo.server.SearchAM

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

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 3/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

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

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 4/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

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/Apply

11. Create Cancel Button

Select ButtonLayout > New > Item

Attribute Property

ID Cancel

Item Style submitButton

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 5/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

Attribute /oracle/apps/fnd/attributesets/Buttons/Cancel

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,
https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 6/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

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,

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 7/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

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

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 8/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

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

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 9/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 10/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

Join the discussion


Visit the Oracle Blog Contact Us
Learn more Learn more

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 11/12
10/2/2017 Update records in OAF Page | Welcome to My Oracle World

Site Map Legal Notices Terms of Use Privacy Cookie Preferences

https://blogs.oracle.com/prajkumar/update-records-in-oaf-page 12/12

Das könnte Ihnen auch gefallen