Thursday 28 March 2013

Part2 Creating Data Entry Page In OAF



Part2 Creating Data Entry Page In OAF

Hi Friends , this is the Second and Last part of Creating Data Entry Page In OAF. Here below is the First part of LOV creating in OAF Page.

Part1:- https://rpforacle.blogspot.in/2013/03/in-this-i-am-going-to-create-data-entry.html



Now we create OAF Page.

Right Click on the project "RohitDataEntryOaf".Click New

 Enter the Page Name="RohitDataEntryPG"

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

we create the page under the webui under the project directory

Click Ok Page has been created.

Below in the Structure Page Click on "region1"
Repalce the ID 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
AM Definition=rohit.oracle.apps.fnd.RohitDataEntryOaf.server.RohitDataEntryAM.

Right Click on the "PageLayoutRN" and then new and then click  region.
 Then region2 has created.

Replace the region2 ID with "MainRN" in the proeprty Inspector.
Change the Region Style=messageComponentLayout,
 Right Click "MainRN".Click New and then Click messageTextInput.
Item1 has created.

Same as like this Create item2,item3,item4,item5,item5,item6.

Now set Values in the property inspector Window for item1.

ID=SupplierId
ViewInstance=SupplierEntryVO
ViewAttribute=SupplierId
Prompt=Supplier No.
Proeprty for item2.

ID=SupplierName
ViewInstance=SupplierEntryVO
ViewAttribute=SupplierName
Prompt=SupplierName


Proeprty for item3.

ID=SupplierAlias
ViewInstance=SupplierEntryVO
ViewAttribute=SupplierAliasName
Prompt=Supplier Alias Name

Proeprty for item4.

ID=SupplierCreationDate
ViewInstance=SupplierEntryVO
ViewAttribute=SupplierCreationDate
Prompt=Supplier Creation Date

Proeprty for item5.

ID=Adress1
ViewInstance=SupplierEntryVO
ViewAttribute=Address1
Prompt=Address1

Proeprty for item6.

ID=Adress2
ViewInstance=SupplierEntryVO
ViewAttribute=Address1
Prompt=Address2


Now we have to write the code for insert data so we need the Controller.

Creeate Controller.

Right Click on "PageLayoutRN".Click Set New Controller.

Enter The Controller Name=RohitDataEntryCO
Package=rohit.oracle.apps.fnd.RohitDataEntryOaf.lov

Put code in the Process Form Request Block as below

OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(WebBean).
am.invokeMethod("create_record");



Click on your Application Module "RohitDataEntryAM" then under Structure Window it shows the RohitDataEntryAMImpl.java

Create two  methods under the RohitDataEntryAMImpl.java
1.



public void createrecord()
{
  OAViewObject vo=(OAViewObject)getSupplierEntryVO();
 
  if(!vo.isPreparedForExecution())
  {
    vo.executeQuery();
  }
 
Row row=vo.createRow();

vo.insertRow(row);

row.setNewRowState(Row.STATUS_INITIALIZED);

}\\\


2.



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







Right Click on "PageLayoutRN".Click New.Click Region.

Region1 has created.
ID=PageButtons
Change the Region Style for region1 is "pageButtonBar".

Right Click on PageButtons Region.Click New.Click Item

 item1 has created under "PageButtons" region.
Change the item1 Proeprty
ID=Save
Item Style=submitButton.


 Write code under the Process Form Request Block under the contrller "RohitDataEntryCO"



  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule oa=(OAApplicationModule)pageContext.getApplicationModule(webBean);
    if(pageContext.getParameter("Save")!=null)
    {
    oa.invokeMethod("saverecord",null);
    }
  }


After this Right Click on the project "RohitDataEntryOaf" and then Click Rebuild.

Rebuild is the compilation of the project.

After successful compilation , Right Click on the page "RohitDataEntryPG".
Click Run.









0 comments:

Post a Comment

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

Name

Email *

Message *