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?
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With