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
Set as favorite
Bookmark
Email This
Hits: 9191
Comments
(11)
...
written by Suneetha , June 20, 2007
written by Suneetha , June 20, 2007
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.
Votes: +0
report abuse
vote down
vote up
...
written by Anil Passi , June 21, 2007
written by Anil Passi , June 21, 2007
.
.
Good question Suneetha.
You are right, that is another possibility. One can indeed get a handle of VO via AM within the controller itself.
There 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.
Thanks,
Anil Passi
Votes: +0
.
Good question Suneetha.
You are right, that is another possibility. One can indeed get a handle of VO via AM within the controller itself.
There 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.
Thanks,
Anil Passi
report abuse
vote down
vote up
...
written by Suneetha , June 22, 2007
written by Suneetha , June 22, 2007
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..
Thanks for the great work you are doing..
Suneetha.
Votes: +0
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..
Thanks for the great work you are doing..
Suneetha.
report abuse
vote down
vote up
...
written by Anil Passi , June 23, 2007
written by Anil Passi , June 23, 2007
Hi Suneetha,
Indeed, that will help a lot of people. I will certainly write something up in the context
Thanks
Anil
Votes: +0
Indeed, that will help a lot of people. I will certainly write something up in the context
Thanks
Anil
report abuse
vote down
vote up
Excellent Inf
written by Dilip , July 02, 2007
written by Dilip , July 02, 2007
Hi Anil,
Thanks for sharing the Important Information.I will be helpful for all apps developers.
Thanks Once again!!
Dilip
Votes: +0
Thanks for sharing the Important Information.I will be helpful for all apps developers.
Thanks Once again!!
Dilip
report abuse
vote down
vote up
...
written by Anil Neema , November 14, 2007
written by Anil Neema , November 14, 2007
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.
Thanks.
Votes: +0
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.
Thanks.
report abuse
vote down
vote up
Error in PPR
written by alimohd , November 26, 2007
written by alimohd , November 26, 2007
Hi Anil,
I did above PPR example.. then I got below Error
Could not load application module 'demo.oracle.apps.ak.ppr01.server.pprAM'.
Please suggest me ASAP
THanks in Advance
Regards
Ali
Votes: +0
I did above PPR example.. then I got below Error
Could not load application module 'demo.oracle.apps.ak.ppr01.server.pprAM'.
Please suggest me ASAP
THanks in Advance
Regards
Ali
report abuse
vote down
vote up
Error while changing the UOM LOV to Drop Down through personalization in iProcurement...
written by Vikki , February 05, 2008
written by Vikki , February 05, 2008
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
Votes: +0
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
report abuse
vote down
vote up
partial page rendering and set required
written by james , October 29, 2008
written by james , October 29, 2008
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
Votes: +0
thanks again
report abuse
vote down
vote up
...
written by Alka , July 22, 2009
written by Alka , July 22, 2009
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
Votes: +0
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
report abuse
vote down
vote up
UI not refreshed when attribute set in PPR event.
written by Chuck , July 23, 2009
written by Chuck , July 23, 2009
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?
Votes: +0
report abuse
vote down
vote up
| < Prev | Next > |
|---|




