3

I'm trying to call a Javascript function on page load using invoke action in AMX page but its throwing exception. I'm using following code. My js file contains following code:

(function(){
if (!window.application) window.application = {};
DayView.gotoFirstOperation =function(){
    var element =document.getElementById('box');
    alert('Method exeuted');
    if( 'null' != element){
    element.scrollIntoView();
    }
}; })();

My invoke action method I'm calling js function in the following code:

AdfmfContainerUtilities.invokeContainerJavaScriptFunction(AdfmfJavaUtilities.getFeatureName(), "DayView.gotoFirstOperation", new Object[]{});

I'm getting following exception:

invokeContainerUtilitiesMethod 'invokeContainerJavaScriptFunction' encountered an error[ERROR[oracle.adfmf.framework.exception.AdfException]-JS Response returned a nil response.].

Is there any other way I can call the js function on AMX page load?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
udaykiran.nalla
  • 109
  • 1
  • 15

1 Answers1

1

Try to add that code inside amx:facet of amx page: And remember to include your js file to maf-feature.xml content list.

 <amx:verbatim id="v1">
<![CDATA[
        <script type="text/javascript">
            document.onload = myMethod();
        </script>
    ]]>
</amx:verbatim>
Magnus
  • 21
  • 5