This post is targeted for ADF beginners, I was discussing today in the office with developers who are just starting with ADF. Its always interesting to see new developers perspective, how they understand framework and what questions they ask. One of the questions I got was about how to reset shuttle component rendered inside ADF dialog framework. By default, ADF task flow rendered inside dialog framework is set to share Data Controls with calling ADF task flow - this preserves statefull state and keeps selected shuttle values. The question was - how we can re-initialize ADF task flow, each time when dialog windows is being opened. We should set ADF task flow rendered inside dialog to be isolated and not to share Data Control with calling task flow - this will force re-initialization of the dialog. We also should explain to new developers to be careful and not to overuse this setting, because it can break transactional logic, use more application module connections than expected, etc. General rule - use isolated scope, when you really need to use it and it doesn't conflict with application logic.
Download sample application - ShuttleAccessApp_v2.zip.
This sample contains landing ADF task flow, implemented as ADF region with fragment. It calls ADF dialog framework to render ADF task flow with pages:
Dialog page is opened, shuttle component is rendered - user selects several items:
Now if we close and then reopen same dialog, shuttle component will keep previously selected values. Depending on use case, may be its what you need, but sometimes you would need just the opposite - each time dialog is opened, it should be re-initialized.
Open ADF task flow, which implements dialog element:
Go to Behavior section, Transaction group and uncheck "Share data controls with calling task flow" - this will make ADF task flow to run in isolated mode:
Run application again, select values from shuttle component:
Close/open dialog window - shuttle will be re-initialized: