Saturday, November 12, 2011

prepareModel, renderModel and the lifeCycle. ADF 11g

Hi,

This is a small post explaining a bit the difference of prepareModel and renderModel options in the refresh property of an InvokeAction.


Those two refresh properties are very self explanatory..

The only difference is the following:

prepareModel: Is executed right after initContext is executed.


renderModel: Is executed right after metadataCommit is executed.


In other words, prepareModel is executed right before any validations or posts or updates take place. Basically, is executed after initContext and before everything else. So, this property is useful for actions and methods that do not require any validation process or updates. It will be executed before all that.

RenderModel, on the other hand, is executed after all those steps are done and passed. So we can use this refresh option when our business logic, or our logic, claims that all steps of the life Cycle should be done.

I understand that this is not the full description nor it is the official documentation. Besides, there is the official documentation for that. But, those lines can be used in everyday developing and I believe that can help in understanding which property we should choose depending on the case.


(Figure 20-1 Lifecycle of a Web Page Request Using JSF and Oracle ADF from 
online documentation regarding ADF LifeCycle)








(Figure 20-2 Lifecycle of a Page Request in a Fusion Web Application from online documentation regarding ADF LifeCycle)


Regards.



References:

10.5.5.3 Correctly Configuring Refresh Property of InvokeAction Executables

20 Understanding the Fusion Page Lifecycle

http://groundside.com/resources/DuncanMills/S298736_bindings.pdf





No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...