This post is about reusable ADF region and its usage from ADF Dialog Framework. If we have ADF Task Flow with fragments and want to use Dialog Framework, we need to create intermediate ADF Task Flow with pages and include our reusable region there - this will allow to load ADF Dialog from the fragment (dialog is always running in ADF page). I will describe in this post how to pass data from/to ADF region included into ADF Dialog to the calling fragment.
There is main ADF Task Flow in the sample - empls-flow (download sample application ReusableDialogRegionApp.zip):
This task flow is configured to call intermediate ADF Task Flow with wrapper page. We are passing and getting parameters to/from the dialog:
Dialog is opened from the button in the main employees fragment:
Button is configured to open dialog:
There is dialog listener defined for this button, it receives return value. Alternatively we can get return value from the dialog return parameter directly:
Intermediate ADF task flow (which actually implements ADF dialog), contains a page and return activity. This page is only a wrapper, it includes reusable ADF region:
Intermediate ADF task flow with wrapper page defines input and output parameters:
Wrapper page contains Close button, this button sets return value, it retrieves return value from the bindings. Because Data Control is shared between reusable ADF region and intermediate ADF task flow with wrapper page, we can access bindings from ADF region and return it from the wrapper page. You can see that this page includes our reusable ADF region:
Here is binding definition for the attribute in the page definition for wrapper page:
And the last bit - ADF reusable region, JSF fragment view:
Bindings for ADF reusable region, you can see where CountryId attribute value is set. We are getting the same value in dialog wrapper page through shared Data Control:
I should mention one important thing - intermediate ADF dialog task flow is configured to run in isolated scope. This is important and allows to reset reusable ADF region in the dialog always to its initial state on opening:
Countries region is loaded and DepartmentId value is passed into:
Selected value is returned back:
The same reusable region is opened from another fragment - region state is reset, user can select value and return it:
There is main ADF Task Flow in the sample - empls-flow (download sample application ReusableDialogRegionApp.zip):
This task flow is configured to call intermediate ADF Task Flow with wrapper page. We are passing and getting parameters to/from the dialog:
Dialog is opened from the button in the main employees fragment:
Button is configured to open dialog:
There is dialog listener defined for this button, it receives return value. Alternatively we can get return value from the dialog return parameter directly:
Intermediate ADF task flow (which actually implements ADF dialog), contains a page and return activity. This page is only a wrapper, it includes reusable ADF region:
Intermediate ADF task flow with wrapper page defines input and output parameters:
Wrapper page contains Close button, this button sets return value, it retrieves return value from the bindings. Because Data Control is shared between reusable ADF region and intermediate ADF task flow with wrapper page, we can access bindings from ADF region and return it from the wrapper page. You can see that this page includes our reusable ADF region:
Here is binding definition for the attribute in the page definition for wrapper page:
And the last bit - ADF reusable region, JSF fragment view:
Bindings for ADF reusable region, you can see where CountryId attribute value is set. We are getting the same value in dialog wrapper page through shared Data Control:
I should mention one important thing - intermediate ADF dialog task flow is configured to run in isolated scope. This is important and allows to reset reusable ADF region in the dialog always to its initial state on opening:
Countries region is loaded and DepartmentId value is passed into:
Selected value is returned back:
The same reusable region is opened from another fragment - region state is reset, user can select value and return it:















7 comments:
Hi Andrejus,
I need to make something like this but I've a problem that I need this popup to open without firing the validation in the page.
For Example I need to use popup like this to insert value in a field and I want the validation is not fired.
if for example Employee ID is not entered the validation will fire.
There is a way - we have implemented it in one of the projects. I plan to blog sample app.
Andrejus
Andrejus,
I tried out your solution in a sample application. I am getting a "ADF_FACES-60101:HTTP Error Status Code: 404" error every time I am accessing the bounded taskflow from the button.
Please note that the jsf page I have used for the TF is under public_html folder and not under WEB-INF.
Am I missing some configuration in the TF call?
Best Regards,
Anirban Mukherjee
Thanks Andrejus,
I'm waiting :)
Hi,
Yes - you should compare one by one differences with my sample app. There can be different reasons for the error you are getting. You can enable ADF log diagnostics FINEST level for ADF Controller - it will show whats wrong.
Andrejus
I get the same error "HTTP Error Status Code: 404" only when I deploy the application in a production environment.
I tried the same technique with JSPX -not JSF-; It works!!! in the embedded weblogic and in the production environment.
This means you are missing something. How come my sample app works with JSF Facelets then? :)
Andrejus
Post a Comment