Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

OA Framework - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

STEP BY STEP AUDIO VIDEO DEMO ON HOW TO BUILD PPR ENABLED OA FRAMEWORK PAGE

In this article, I will explain the concepts of PPR and this will be followed by a step by step audio visual demo of how to build a page with PPR in OA Framework.

SPEL is the basic foundation of Partial Page Rendering in OA Framework.
Hence, I request that prior to reading this article & watching this demo, you must see audio-visual presentation of SPEL, at this link.

Why PPR?

PPR is used to change the contents of the page dynamically if certain events take place.
In this article I will explain the concepts of partial page rendering and its usage with SPEL in OA Framework.
This will be followed by an audio visual demo that shows how to build one such PPR based screen.


Lets take an example

On a screen, there is a field named UOM, presented as a drop down list.
Lets assume a business case :-
1. If the UOM from drop list changes to "Each", then a field named "Number of units" must be displayed.
2. As soon as drop down list value changes to "Box", then a field named "Box Weight" must be displayed
3. As soon as drop down list value changes to "Gallon", then a field named "Volume" must be displayed
At any given point in time, only one additional field must be displayed, depending upon the value of the dropdown list.


What makes PPR so special?
By using Partial Page Rendering, the entire page is not refreshed.
Only the changed portion of the web page will be redrawn.
This reduces the network traffic and enhances the user experience.



Where does SPEL [Simplest Possible Expression Language] fit in?
Using SPEL, you can bind(attach) certain properties of a field to a View Object[VO] attribute.
This View Object attribute will be of type Boolean.
As per Oracle documentation, the name of such view object must end with PVO.


In plain English this means [in the context of this example]:-
1. A transient view object attribute returns Boolean i.e. TRUE or FALSE
2. This view object attribute could be attached to Rendered property of a field [or any other property that support SPEL binding]
3. A change in drop down list value will initiate a partial Action, which can be trapped in Controller processFormRequest.
4. This partial action trigger will check the current values of those Boolean attributes in View Object.
5. The dependent field will either be displayed or hidden, depending upon the Boolean value of the view object attribute.
NOTE:- The Video depicting end result of this exercise can be be seen from this link



What triggers the partial page refresh?
In this case, the change to LOV Drop down list value triggers PPR.
You will find the details in audio visual demo below


Can all types of bean trigger off a Partial Action?
Not really, the list of beans that can trigger a partial action are:-
1. List box.
2. Subtabs, for example, changing from one tab to another can refresh only the relevant portion of the page
3. Context switches in Flexfields is another example of PP in OA Framework
For full list, please refer OA Framework Documentation


Is partial page rendering the same as web2.0?
Yes, end result is similar. However PPR has limited usage in terms of full blown capabilities of web2.0/DHTML


Any special considerations?
Yes, oracle suggests that the name of the view object used for PPR, must end with PVO.



What are the steps for building one such partial page rendering enabled page?

We will go through the steps one by one in audio-video

Step 1
---------
Create a table upon which our OA Framework screen will be based
This can be done by using command below.
Note:- it is not mandatory to use EO[Entity Object] based screen for this demo, but I am hoping that this demo will also serve the purpose of showing you "how to create a base table" screen in OA Framework.
CREATE TABLE xx_test_ppr01
(
uom VARCHAR2(30)
,box_weight NUMBER
,number_of_units NUMBER
,volume NUMBER
,LAST_UPDATE_DATE DATE
,LAST_UPDATED_BY NUMBER(15)
,LAST_UPDATE_LOGIN NUMBER(15)
,CREATION_DATE DATE
,CREATED_BY NUMBER(15)
) ;




Step 2
Create java based packages for both BC4J and MDS page and its controller.
Also create an entity object, followed by a view object.
This audio/video can be seen by clicking on this link
Note: Entity Objects are not needed for such demo, but yet I have followed this approach,
so that beginners can see how OA Framework screens can be created for Base Table.



Step 3
Create a page that is based on the view object created above.
The audio-video demo for this step can be accessed by clicking on this link


Step 4
This step consists of following sub-steps
1. Bind the Boolean attributes of PVO to the respective fields
This will Control the runtime rendered property of these fields when partial action occurs [change in LOV]
2. Lets also make sure that changes to UOM drop down list initiates the partial action.
These steps can be seen by clicking on the link here
The audio-video demo for this step can be accessed by clicking on this link


Step 5
Prepare a controller, that does two things
processRequest
---------------------
initializes the record, as soon as the page is rendered on browser
Here we will make a call to the AM

processFormRequest
---------------------------
Here, we will call a method in AM. Within that AM we will do the following:-
1. Get a handle to the current record on the screen ( in this case there is only one record possible)
2. From the current record, depending upon the value selected in drop down list, change the values of Boolean attributes. Keep in mind that these Boolean attributes are attached to rendered property of the respective fields.
The audio-video demo for this step can be accessed by clicking on this link



Step 6
In this step, we will write code for our Application Module, which is responsible for setting the Boolean Attributes.
Rebuild project and Test to see this working.
The audio-video demo for this step can be accessed by clicking on this link



Source code for this tutorial can be downloaded from this zip file location



Anil Passi

Comments   

0 #1 Suneetha 2007-06-20 00:00
This was a really good tutorial and i really learned a lot about PPR.. I have a question as to why invoke the methods in AM when to set the values for the boolean attributes that are being used in SPEL.. Can it be done in the controller code ?? Thanks for your help, Suneetha.
Quote
0 #2 Anil Passi 2007-06-21 00:00
.
.
Good question Suneetha.
You are right, that is another possibility. One can indeed get a handle of VO via AM within the controller itself.

Ther e are multiple ways of doing things in OAF.

Third variation is that we simply override the get[Attribute] in VO, and in those get[Attribute] methods we return TRUE or FALSE appropriately, depending upon what getUom returns.

Tha nks,
Anil Passi
Quote
0 #3 Suneetha 2007-06-22 00:00
Thanks for your quick reply Anil.. One more request.. Can we have couple of articles from you on extending the seeded pages like IProcurement or some thing like that.. The reason is still there are lot of people still facing problems on how to run seeded pages from Jdeveloper.. questions like
1.How to add server.xml file to the project and where you will find it.. I know with some releases we were not able to find.. I was told you can build the server.xml if oracle does not have one.. Is it possible if so how?
2. What needs to be copied to the local machine (My Projects and My classes directories).
3. How to import Export and Import from the server to the local machine..

I know they are documented but still very difficult to get it one place.. Hope you will take on these in your next articles..

T hanks for the great work you are doing..

Sune etha.
Quote
0 #4 Anil Passi 2007-06-23 00:00
Hi Suneetha,

In deed, that will help a lot of people. I will certainly write something up in the context

Than ks
Anil
Quote
0 #5 Dilip 2007-07-02 11:17
Hi Anil,

Thanks for sharing the Important Information.I will be helpful for all apps developers.

Th anks Once again!!

Dilip
Quote
0 #6 Anil Neema 2007-11-14 05:44
Dear Anil,
I am following the same approach to disable a column of a table based on the the other column of the same table which is a messageChoice but it disables the column of all the rows of the table i want to disable only the column of that particular row of which the messageChoice was selected.
Thank s.
Quote
0 #7 alimohd 2007-11-26 10:03
Hi Anil,
I did above PPR example.. then I got below Error

Could not load application module 'demo.oracle.ap ps.ak.ppr01.ser ver.pprAM'.

Please suggest me ASAP
THanks in Advance
Regards
Ali
Quote
0 #8 Vikki 2008-02-05 11:30
Hi Anil,

I am getting an error, while i am changing the UOM Lov to Mesaage Choice(drop down list)... can u plz help me in this... why it is happening so??

Thanks,
Vikki
Quote
0 #9 james 2008-10-29 13:13
anil yet another tutorial by you on ppr. got it working . but the question i have is how do you cause a field to be set required or not by using ppr. when i come off item 1, item9 should be changed to required. is this possible if so how.
thanks again
Quote
0 #10 Alka 2009-07-22 09:11
Hi Anil,

Thanks for sharing your expertise so generously. Your articles are very informative.... .I esp. like the ones with video demos.

A request, could you come up with something on PPR at row level in a table?

Regards ,
Alka
Quote
0 #11 Chuck 2009-07-23 10:41
I have a page with a PPR event handler method for attribute A. In the corresponding EO, attribute B gets a default value when attribute A is set. When the PPR event fires, attriibute A gets updated in the EO, attribute B gets updated in the EO but the page only displays the new value for attribute A not B. Is there something I need to do to get attribute B to refesh on the page?
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Apr 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
  1  2  3  4  5  6  7
  8  91011121314
15161718192021
22232425262728
2930     

Enquire For Training

Related Items

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner