Tuesday, May 30, 2017

ADF PopUp Event Context Launcher

I will describe how you could use ADF popup event context to pass parameters into popup. This could be useful if you want to develop reusable popup, which should accept different type of parameters from various launcher components.

In this example - popup is loaded from context info. Launcher component - output text is assigned with attribute, reading its value from binding. Our goal is to pass attribute value into popup:


In order to be able to read attribute value from launcher parent component, make sure to set eventContext="launcher" for ADF popup:


You can reference parent UI component from launcher property, this can be done in popup fetch listener - where value will be copied to managed bean property:


We could process launcher parent component in managed bean, extract values, etc.:


Value retrieved from popup launcher is displayed in the popup:


Download sample application - PopUpEventContextApp.zip

2 comments:

Anonymous said...

Hi Andrejus,

this works only in pages (jsf) not in fragments (jsff), am I right?


Artur

Andrej Baranovskij said...

In our project we use it in the fragments, it works in both pages and fragments.

Regards,
Andrejus