Home » ADF » Using Method Call Activity to open form on Insert Mode
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.

public String myMethodCall()
{
BindingContext bindingctx=BindingContext.getCurrent();
BindingContainer binding=bindingctx.getCurrentBindingsEntry();
OperationBinding operationBinding = binding.getOperationBinding("CreateInsert");
operationBinding.execute();
return "go";
}

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

Output

7-05-11

Sample Code

About Manish Pandey

Manish Pandey is a Senior Developer with more than 3 years of experience in JAVA Programming. Currently enhancing skills in ADF.

2 comments

  1. Hi Manish…
    I am confused about one scenario..
    I have 3 tables.
    1. Users- Id(PK-Sequence), Username, Password, RoleID(FK), TelephoneID(FK)
    2.Role-Id(PK-Sequence),RoleName
    3.Telephone-Id(PK-Sequence),Office_No,Mobile_No
    I need to create a form in UI which takes values like
    Username,Password,RoleName,Office_No,Mobile_No
    After the user enter the values in the form, It should update values in all the tables..
    My Problem is,
    I couldn’t able to update the values RoleId(FK) and TelephoneID(FK) in my Employees Table…
    Can you please help me and guide me with this?
    I can send the sample project so that you can also take a look..
    Do reply me thanks.
    Thanks

    Read more: http://www.techartifact.com/blogs/2013/05/using-log4j-in-oracle-adf-application.html#ixzz2TRwt1ZFU

  2. I followed the above exampe to the latter but when i run, I get the following error:

    Target URL — http://127.0.0.1:7101/ApplicationFormInsert-ViewController-context-root/faces/Emp.jsf

    javax.el.PropertyNotFoundException: Target Unreachable, ‘null’ returned null
    at com.sun.el.parser.AstValue.getTarget(AstValue.java:171)
    at com.sun.el.parser.AstValue.getMethodInfo(AstValue.java:225)
    at com.sun.el.MethodExpressionImpl.getMethodInfo(MethodExpressionImpl.java:232)
    at oracle.adf.controller.internal.util.ELInterfaceImpl.getReturnType(ELInterfaceImpl.java:222)
    at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:152)
    at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1241)
    at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:1087)
    at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:979)
    at oracle.adfinternal.controller.engine.ControlFlowEngine.invokeTaskFlow(ControlFlowEngine.java:253)
    at oracle.adfinternal.controller.state.ChildViewPortContextImpl.invokeTaskFlow(ChildViewPortContextImpl.java:110)
    at oracle.adfinternal.controller.state.ControllerState.createChildViewPort(ControllerState.java:1558)
    at oracle.adfinternal.controller.ControllerContextImpl.createChildViewPort(ControllerContextImpl.java:92)
    at oracle.adf.controller.internal.binding.TaskFlowRegionModelViewPort.createRegionViewPortContext(TaskFlowRegionModelViewPort.java:881)
    at oracle.adf.controller.internal.binding.TaskFlowRegionModelViewPort.getViewPort(TaskFlowRegionModelViewPort.java:679)
    at oracle.adf.controller.internal.binding.TaskFlowRegionModelViewPort.doProcessBeginRegion(TaskFlowRegionModelViewPort.java:262)
    at oracle.adf.controller.internal.binding.TaskFlowRegionModelViewPort.processBeginRegion(TaskFlowRegionModelViewPort.java:163)
    at oracle.adf.controller.internal.binding.TaskFlowRegionModelLocal.processBeginRegion(TaskFlowRegionModelLocal.java:12)
    at oracle.adf.view.rich.component.fragment.UIXRegion$RegionContextChange.doChangeImpl(UIXRegion.java:1436)
    at oracle.adf.view.rich.context.DoableContextChange.doChange(DoableContextChange.java:91)
    at oracle.adf.view.rich.component.fragment.UIXRegion._beginInterruptibleRegion(UIXRegion.java:777)
    at oracle.adf.view.rich.component.fragment.UIXRegion.processRegion(UIXRegion.java:520)
    at oracle.adf.view.rich.component.fragment.UIXRegion._preRenderView(UIXRegion.java:1064)
    at oracle.adf.view.rich.component.fragment.UIXRegion.processEvent(UIXRegion.java:1025)
    at oracle.adfinternal.view.faces.lifecycle.PreRenderViewUtils$1.visit(PreRenderViewUtils.java:122)
    at oracle.adfinternal.view.faces.lifecycle.PreRenderViewVisitContext._invokeVisitCallback(PreRenderViewVisitContext.java:153)
    at oracle.adfinternal.view.faces.lifecycle.PreRenderViewVisitContext.invokeVisitCallback(PreRenderViewVisitContext.java:132)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:604)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
    at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
    at oracle.adfinternal.view.faces.lifecycle.PreRenderViewUtils._visit(PreRenderViewUtils.java:110)
    at oracle.adfinternal.view.faces.lifecycle.PreRenderViewUtils.__deliverPreRenderViewEvents(PreRenderViewUtils.java:61)
    at oracle.adfinternal.view.faces.lifecycle.ResponseRenderManager._processViewDefinitionLanguage(ResponseRenderManager.java:115)
    at oracle.adfinternal.view.faces.lifecycle.ResponseRenderManager.runRenderView(ResponseRenderManager.java:41)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1095)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:389)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:255)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:327)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:229)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:220)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
    at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
    at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)

    .

    Assist ASAP

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>