Skip to main content

Conditionally Resetting Task Flow Displayed In a Popup

Use Case 
A task flow is embedded in af:poup. The content needs to be reset each time user view this.

Solution
Use activation and active property to control  the life span of task flow.Activate task flow when user  open the popup window. Deactivate it when popup is disposed. Please see developer guide to learn more about these properties:  Configuring Activation of an ADF Region


Download 
You can download the sample workspace from here.
The main.jsf page contains a task flow(dept-task-flow) with a search view embedded inside an  af:popup . Each time you invoke the popup, the search panel state in the popup is reset as the task flow is re-activated each time.

[ Runs with Oracle JDeveloper 11.1.2.1.0 (11g R2PS1) + HR Schema]

Learn More ...
There are a lot more points like this. If  you are curious to learn the internals of the ADF Business Components and ADF Binding Layer,  the following book is for you - Oracle ADF Real World Developer’s Guide.
More details about this book can be found in this post- http://jobinesh.blogspot.in/2012/07/pre-order-your-copy-of-oracle-adf-real.html

Comments

Mahmoud Ahmed said…
Hi Jobinesh,

Try replace the panel window in the popup with a dialog component , your solution will work only when the dialog cancel button is pressed but when Ok button pressed the re-activation is not working ... do you have any idea about this issue.

Thanks , Mahmoud Abdultawab
Mahmoud Ahmed said…
Hi Jobinesh,

We have to put the same popup canceled listener code inside the dialog listener to invert the condition.

public void dialogListener(DialogEvent dialogEvent) {
// Add event code here...
ADFContext.getCurrent().getPageFlowScope().put("forceActivate", "false");
}

Sorry for the disturbance.

Popular posts from this blog

Happy New Year 2018 !

We can't go back and change the beginning, but we always can start where we are and change the ending. Believe in yourself and you will be unstoppable!

Wishing you and your family a very happy new year 2018 !!!

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…