Friday, July 1, 2016

Set Default Value for messageTextInput in OAF

1. Create a New OA Workspace and Empty OA Project
File > New > General > Workspace Configured for Oracle Applications
File Name – SetDefaultValDemo

Automatically a new OA Project will also be created

Project Name -- SetDefaultProj
Default Package -- def.oracle.apps.fnd.setdefaultproj

2. Create Application Module AM
Right Click on SetDefaultProj > New > ADF Business Components > Application Module
Name -- SetDefaultAM
Package -- def.oracle.apps.fnd.setdefaultproj.server
Check Application Module Class: SetDefaultAMImpl Generate JavaFile(s)

3. Create a OA components Page
Right click on SetDefaultProj > New > Web Tier > OA Components > Page
Name -- SetDefaultPG
Package -- def.oracle.apps.fnd.setdefaultproj.webui

4. Select SetDefaultPG 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
Form Property
True
Auto Footer
True
Window Title
Set Default Value Window Title
Title
Set Default Value Header
AM Definition
def.oracle.apps.fnd.setdefaultproj.SetDefaultAM

6. Create the Second Region
Right click on PageLayoutRN > New > Region

Attribute
Property
ID
MainRN
Region Style
messageComponentLayout

7. Create messageTextInput
MainRN > New > messageTextInput

Attribute
Property
ID
MyTextitemId
Style Property
messageTextInput
Length
20
Maximum Length
50

8. Save Your Work

9. Add a Controller
MainRN > Set New Controller

Package Name -- def.oracle.apps.fnd.setdefaultvaldemo.webui
Class Name -- SetDefaultValCO

10. Edit Your Controller
Add Following Code in processRequest

import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
 super.processRequest(pageContext, webBean);
 String myValue = "Vishnu teja"; 
 OAMessageTextInputBean textBean = (OAMessageTextInputBean)webBean.findChildRecursive("MyTextitemId");
 textBean.setValue(pageContext, myValue);
}


11. Test Your Work


END

No comments:

Post a Comment