Sunday, December 7, 2014

ADF af:popup contentDelivery attribute

ADF af:popup contentDelivery attribute


This component is available in JDeveloper 11g ADF Faces Rich Client, I personally like how it works and how it looks. In this post I will discuss on how the contentDelivery Property determines the contents of Popup.

Actually, pop-up functionality is created in two steps:


1) First we set up the contents of af:popup component
















2) Put af:showPopupBehavior component on whatever action component where you want to show a popup.












Important - af:popup should have the same Id value as af:showPopupBehavior component, this will allow to open pop-up when action component is pressed.

The contentDelivery attribute of an af:popup component controls the popup initialization time and how does the data get refreshed within the popup.


How does the contentDelivery property on af:popup works,contentDelivery defines when data on the page are refreshed from the Model layer. The default value is “lazy,” which means that the contents will be refreshed only when the popup first displays. The value “lazyUncached” signifies that the data should not be stored between displays; the values will be refreshed each time.Another value, “immediate,” causes the popup to be loaded when the base page is loaded even before the popup is displayed.


Typical Use Case which we use to test this property is to have a Table with a view menu on the top.When a specific record in the table is selected and the view menu is pressed then the popup will show the specific details of the record selected in the table.


i) contentDelivery - lazy


During contentDelivery lazy the contents will be refreshed only when the popup first displays, so first the record selected in the table was of Lex and even after David was selected the contents of the popup is still not refreshed and only shows Lex.




















ii) contentDelivery - lazyUncached

During contentDelivery - lazyUncached the data should not be stored between displays; the values will be refreshed each time.So every time the record is selected in table the content of popup is refreshed.

















iii) contentDelivery - immediate

During contentDelivery - immediately the popup data is loaded when the base page is loaded even before the popup is displayed.So the popup always shows the first record of the table in the popup and it does not get refreshed during multiple selections of records in table.




4 comments: