Sunday 10 March 2013

Assign Default Values In OAF Page

Assign Default Values In OAF Page

Hi Friends, we are going to discuss about the Assign Default Values In OAF Page. We will share the detail steps to how we can put the code in the OAF Page controller to assign the default values in the OAF Page. Please find below the complete details about Assign Default Values In OAF Page.

Step by step to Assign Default Values In OAF Page

1.Create a new workspace name "DefaultValueAssign".
Right Click on "Applications".Click on "NewOAWorkspace".

Assign Default Values In OAF Page
Assign Default Values In OAF Page

Enter the name of Workspace="DefaultValueAssign".Click Ok.

Assign Default Values In OAF Page
Assign Default Values In OAF Page
Project wizard will open as below click next.

 Enter the name of the Project="DefaultValueAssign".
Default Package= "rohit.oracle.apps.fnd.DefaultValueAssign"

Package determines the directory where the java class files and other files related to this project strored.
In this directory oracle.apps.fnd must be required."fnd" is the oracle application shortname you can use other applications like "ak" in this.
  Enter the RunTime connection details as below.Enter the E-business Suit Application User Name and Password.(already explained in the JDev installation)

Workspace and project has been created as below.

 Now our next step is to create a "Application Module" for the OAF Page

Right Click on the project "DefaultValueAssign".Click New




Application Module wizard has open as below click next

 Enter the Application Module name="DefaultValueAssignAM"

Defualt Package="rohit.oracle.apps.fnd.DefaultValueAssign.server"

we create "Application module" under the "Server" directory of the project as OAF Standard.

Click next and then finish.



 Application Module has created as below




Now we create a OAF Page as below

Right Click on the Project "DefaultValueAssign".Click New.



Click on the Page.Click on ok Button


Enter the Page Name="DefaultValueAssignPG"

Default Package="rohit.oracle.apps.fnd.DefaultValueAssign.webui"

we create the page under the webui under the project directory.







Page has created as below.




when you click the "DefaultValueAssignPG" Below structure pane has dispayed as below
Change the name of the "region1" with "PageLayoutRN" in the property inspector.



Click on the "PageLayoutRN".On the right hand side In the property inspector we  will set the AM for the this page



Enter the Window Title and Title in the Property inspector of region1.

 

Right Click on the "PageLayoutRN" and then new and then click  region.


 Then region2 has created.

Replace the region2 name with MainRN. and then change the Region Stylewith "messagecomponentlayout"
Region Style= "messagecomponentlayout".
Right Click "MainRN" and then click new.and then select "messagetextinput"


Then item1 has created under the MainRN region.
Create the Item2 like Item1 as above.
 So at last two messagetextinput has been created under the MainRN.

Now we have write a logic when the page load defualt values will assign to the item1 and item2 .So we create a controller for this page.
Right click on the "PagelayoutRN".Click Set New Controller












Enter the name of the controller=DefualtValueAssignCO
We have to show the defualt value for item1 and item2 so we put our code under the block "Process Request".Item1 will shows the sysdate and item2 will show Current User Name.

for this the below is the code in the process request of the controller

OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);

OADBTransaction trx=(OADBTransaction)am.getOADBTransaction(); 
 Date val=(Date)trx.getCurrentDBDate();

String val1=pageContext.getUserName(); 

OAMessageTextInputBean textbean=(OAMessageTextInputBean)webBean.findIndexedChildRecursive("item1")
OAMessageTextInputBean textbean1=(OAMessageTextInputBean)webBean.findIndexedChildRecursive("item2");
textbean.setValue(pageContext,val);

textbean1.setValue(pageContext,val1); 
 After this rebuild your project like below.Right Click on the Project "DefualtValueAssign" and then click "Rebuild".

After Compilation Right click on the project "DefualtValueAssenign" and then click run

The output of this project is Below











If you want to see Other OAF Related Posts , Please visit Below URL.https://rpforacle.blogspot.in/2013/03/oaf_10.html



If you want to see  Oracle Fusion Related Posts , Please visit Below URL.

https://rpforacle.blogspot.in/2018/01/oracle-fusion-learning-tutorial.html

If you want to Learn Oracle Workflow Builder, Please visit Below URL.

https://rpforacle.blogspot.in/2018/01/oracle-workflow-learning-tutorial-1.html

2 comments:

Sumit B said...

Good info. But in the controller code provided, there is error in deriving Date value

OADBTransaction trx=(OADBTransaction)am.getOADBTransaction();
Date val=(Date)trx.getCurrentDBDate();

Anonymous said...

Good Blog.Thanks for sharing this information and helpful for me
Oracle Fusion Financials Online Training
Oracle Fusion Technical Online Training

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *