• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Displaying Data From Data Base

In this lesson we are going to see how to display a data from the data base in OAF.

Follow the steps to display the data in OAF page from the Data Base:

  1. Create the page.
  2. Create the VO in respective BC4J and attach it to AM.
  3. Create the controller and write the logicode in Process Form Request.

To create a VO right Click on the Resources Folder of the project and then select New View Object…

To see all the steps that how to create the VO we can see in previous chapter.

Write the following Query statement in VO

SELECT * FROM mtl_system_items_b WHERE  ROWNUM < 101

After creating VO attach VO to AM (Application Module).

Now select main page right click on the main region select New -> Region Using Wizard…

61

After selecting Region Using Wizard then a welcome window will get open as shown below:

62

Click on Next button to see the first step:

63

After selecting proper AM we can see the VO attached to that AM in the Available View Usages, which is shown below:

64

Click on Next button, in Step2 window select Region Style as “table“, the same scenario is shown in the below figure:

65

In the next window we will find all the available attributes and in that select the attributes whichever required to display

66

Click on Next button then we will find a window in that we can change the prompt names if required and also the style of the item we can change here we are taking all the items as Message Text input types.67

Click on Next button and then click on the finish button.

68

After creating Region Using Wizard now create one more item and the Item Style is “Submit Button”. So that the page structure looks like the following:69

Now create one controller on the main region. Right click on the region1(Main region id) and then select Set New Controller…

Now after creating the controller write the following code in the process Form Request.

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{

super.processFormRequest(pageContext, webBean);

if(pageContext.getParameter(“item1”)!=null)

{

/* The below code line is used to initialize the application module */

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

/* The below code line is used to initialize VO*/

OAViewObject vo=(OAViewObject)am.findViewObject(“ItemsVO1”);

/* ItemsVO1 is the instance name in AM which is the original name of the VO */

vo.executeQuery();

}

}

Rebuild the code, run the page and see the output:

70

Click on the “Go” button so that it will display the records as shown below

71

 

Summary
Review Date
Reviewed Item
Displaying Data From Data Base
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Displaying Data From Data Base"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.