Posts

Showing posts with the label ADF Controller

Forcing Task Flow instances with Shared Data Control to use different view object instances

Image
If you have have a task flow designed to use shared data control, and still don't want different instances of task flows to use same view object instances, then this post is for you. Use case: Multiple instances of task flow should share same transaction context, however each UI should work independently when they are embedded in a parent page. As of now, there is no direct support for this. In this post I'm sharing a work around solution for this kind of scenario. Solution: As I said earlier, this is just a work around solution, and intended to give you some idea on the implementation. Feel free to modify the code in the attached sample to meet your use cases. Step 1 . Edit the iterator used for for those pages fragments which needs to work independently, and alter binding for the view object instance used for this iterator to use an EL. EL takes the view object instance name from a PageFlow scoped variable. <iterator Binds="#{pageFlowScope.VOInstName}...

What you may need to know about the conditional activation of the task flow embedded in an <af:popup> ?

Image
You can configure the activation of task flow using 'active' property of the taskFlow binding. The details are available in the fusion developers guide - 21.6 Configuring Activation of an ADF Region I would like to share a couple of points I learned on this topic while working with developers. Its interesting and may save your time as well ;) While configuring the activation of task flow, you may need to key in value for activation and active flags. Apart from these two, there is one more attribute RefreshCondition which decides the 'life' of task flow. Common mistakes in using RefreshCondition and active properties RefreshCondition="#{some.EL.expression}": The ADF region is refreshed when RefreshCondition evaluates true. Please note that you may not really need to use this for lazy initialization of task flow, use active and activation flags instead. In case, if you are using this, please note the RefreshCondition should only evaluate to true whe...

Creating Task Flow bindings on the fly

Image
A very common demand from the community was support for adding regions at run time. The good news is that 11.1.2 release has support for adding regions dynamically which is now well supported by a task flow binding layer as well. Wow...excited? Please see 21.10 Configuring a Page To Render an Unknown Number of Regions in developers fusion developers guide to learn more about this topic. Let me give you a quick overview on the implementation. Its very easy. 1. Build the logic to return TaskFlowBindingAttributes list for dynamic task flows First step is to build a managed bean to hold your business logic for building list of oracle.adf.controller.binding.TaskFlowBindingAttributes as shown in the following code snippet. private List<TaskFlowBindingAttributes> taskFlowBindings = new ArrayList<TaskFlowBindingAttributes>(); public void buidTaskflowBindings(){ TaskFlowBindingAttributes tfBindAttr1 = new TaskFlowBindingAttributes(); tfBindAttr1.setId...

ADFc: No outcome metadata specified for method call activity 'null' !

Image
While defining task flow method activities by EL binding to a method in managed bean, there are certain things you need to be aware of. These points are well documented in Fusion Developer's Guide under 15.5 Using Method Call Activities . I'm explaining a very common mistake when you EL bind a manged bean method as method activity for a task flow. In this case, if your method return some status message and you want to control navigation cases based on this outcome, its required to specify 'toString()'[displayed under Outcome group] as 'true' from the drop down list, as shown in the following screen shot. <method-call id="someMethodCall"> <method>#{backingBeanScope.managedBean1.doSomething}</method> <outcome id="__16"> <to-string/> </outcome> </method-call> to-string: If specified as true, the outcome is based on calling the toString() method on the Java object returned b...

Triggering Navigation from a Contextual Event Handler Method

Image
ADF task flows are key building blocks for a Fusion Web Application. You can render a bounded task flow in a page using ADF region . Often a parent page may need to trigger navigation within the embedded region while responding to specific user actions. This blog post discusses such a use case scenario and a possible solution for the same. Consider a generic case where a JSF page contains a bounded task flow added as a region. Here the requirement is that when user selects specific option displayed on the parent page, the ADF region's content(taskflow view activity) should navigate to an a new view/page. Let me try to explain this scenario with a more realistic example. Please see the following diagram. You may notice that deptemp-task-flow-definition is added as region to a page and the this page is having two buttons to edit the department and employee details. On clicking these buttons on parent page, the 'embedded' deptemp-task-flow should navigate to the correspondin...

Disabling dispatch of Contextual Events

You can turn off the event dispatch to regions (and child regions) having eventMap with 'producer region' as 'Any'(*) by setting DynamicEventSubscriptions="false" in the pageDefinition file <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="11.1.1.56.60" id="somePageDef" Package="view.pageDefs" DynamicEventSubscriptions="false">

Refresh the parent view when a taskflow displayed in a popup returns

Image
This post discusses an interesting use case on refreshing the parent view when an in-line popup taskflow returns. There are two taskflows, both work with separate transaction contexts(Transaction attribute is set as new-transaction). Second taskflow is invoked from the first one as a dialog. The requirement here is to refresh the 'executables' of calling page(from first taskflow) when the second taskflow returns. This scenario usually arises when the second task flow updates tables used by the first one from a different transaction context. To learn more on taskflow, please refer Part III Creating ADF Task Flows in Fusion Middleware Fusion Developer's Guide for Oracle ADF. Cool, now back to the use case. One possible solution for the above scenario is to define a returnListener for secondary window on the command button (which invokes second taskflow as dialog) and add the custom logic to refresh the underlying IteratorBindings used by the parent page. Last step is ...

EL to see whether a view activity is authorized for the current user

You can use the below EL to see whether a specific view activity is authorized for the current user #{controllerContext.security.activity['your_view_activity_id'].viewAuthorized} This is useful where you need to skip the rendering of links that refer to a page which is not authorized to view by the current user. Please refer ControllerSecurityManager api to learn more. You can download the sample workspace from here . Run the login.html. Login to application as as guest/welcome123, application displays only 'Department' link. If you login as admin/welcome123, then application displays both 'Department' and 'Employee' links. [Runs with Oracle JDeveloper 11g R1 PS2 + HR Schema]