Using Method Call Activity to open form on Insert Mode

Using Method Call Activity to open form on Insert Mode

This is very common scenario where a user wants to execute some code before the page loads. For this purpose, ADF Framework provides Method Call Activity. Method Call Activity creates a method on your managed bean which is being called first and after that, the jspx page loads. In my example I have created a simple form using employees table and when page load form opens inn Insertion mode because I have executed CreateInsert method of this View Object on method call activity.
Step1: Create Entity Object based View Object.
Step2: create Adf task Flow

7-05-1

Step3: In Task Flow drag-drop View component from component Palette to create Fragment page.

7-05-2

Step4: Double Click on Emp View to create jsff page.

7-05-3

Step5: Create java class for managed Bean

7-05-4

Step6: Register java class as managed bean on ADF task flow.

7-05-5

Step7: Create Method Call Activity to drag-drop Method call component on task flow from component palette.

Step8: Right click on Method call select Mark Activity -> Default Activity

Step9: Drag-drop Control flow from Method call to jsff page from component palette.

7-05-6

Step10: Create method on Empbean class. And set method name of Method property of and Fixed outcome t o “go”.

7-05-7

Step11: Drag-drop Employees View Object as ADF form from data control.

7-05-8

Step12: Right Click on Method Call Activity from and create Page Definition File.

7-05-9

Step13:Add Action Binding for Employee View Object CreateInsert operation.

7-05-10

Step14: Add following line to myMethodCall to call createInsert operation.

  1. public String myMethodCall()  
  2. {  
  3. BindingContext bindingctx=BindingContext.getCurrent();  
  4. BindingContainer binding=bindingctx.getCurrentBindingsEntry();  
  5. OperationBinding operationBinding = binding.getOperationBinding(“CreateInsert”);  
  6. operationBinding.execute();  
  7. return “go”;  
  8. }  
  1. public String myMethodCall()  
  2. {  
  3. BindingContext bindingctx=BindingContext.getCurrent();  
  4. BindingContainer binding=bindingctx.getCurrentBindingsEntry();  
  5. OperationBinding operationBinding = binding.getOperationBinding(“CreateInsert”);  
  6. operationBinding.execute();  
  7. return “go”;  
  8. }  

Step15: Create jspx page and drag-drop task-flow-definition as static region.

Output

7-05-11

Sample Code

About Manish Pandey

Manish is a Project Leader at Jagran Prakashan Ltd, focused on Jdeveloper Fusion Web Application(specifically Oracle ADF). He shares his knowledge through the OTN Jdev/ADF Forum. He has written more than 50 article about Oracle ADF and Jdeveloper.

Leave a Reply