on 02-17-2015 1:56 PM
Hi,
when running the application in Chrome, I'm receiving the following error message:
Uncaught TypeError: undefined is not a function
(anonymous function)
and this point to the line:
var someObject = document.SomeApplet.getQueryObject();
I'm not receiving this error message in IE or Firefox. How to resolve the issue?
Thx
Have you made sure your applet is fully loaded an initialized before you make your call to the getQueryObject function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it works in other browsers, problems are just in Chrome
<APPLET name="SomeApplet" CODEBASE="/XMII/Classes" CODE="iCommand" ARCHIVE="illum8.zip" WIDTH="0px" HEIGHT="0px" MAYSCRIPT="mayscript">
<PARAM NAME = "QueryTemplate" VALUE="some_valid_path_to_Xacute_query" />
<PARAM NAME="Param.1" VALUE="param1_value" />
<PARAM NAME="Param.2" VALUE="param2_value" />
<PARAM NAME="Param.3" VALUE="param3_value" />
</APPLET>
Try using the applets 'CreationEvent'
Applet Events - SAP Manufacturing Integration and Intelligence - SAP Library
Without that there is no guarantee that your script will execute after your applet is ready.
Hi Tibor,
Nothing to do with Height and Width.
Also, can you let me know where exactly have you put above code that is generating error.
This would help me suggest a better way.
About creation event, please find the same below:
<APPLET name="SomeApplet" CODEBASE="/XMII/Classes" CODE="iCommand" ARCHIVE="illum8.zip" WIDTH="0px" HEIGHT="0px" MAYSCRIPT="mayscript">
<PARAM NAME = "QueryTemplate" VALUE="some_valid_path_to_Xacute_query" />
<PARAM NAME="Param.1" VALUE="param1_value" />
<PARAM NAME="Param.2" VALUE="param2_value" />
<PARAM NAME="Param.3" VALUE="param3_value" />
<PARAM NAME="CreationEvent" VALUE="FUNCTIONTO CALL" />
</APPLET>
Where FUNCTIONTOCALL is the function that contains var someObject = document.SomeApplet.getQueryObject();
Hope this helps.
Best Regards,
Swaroop
Hi Tibor,
Applet loads independent of page. Your document may be ready but the applet may not, that is the reason it's not recommended to use page lifecyle events with applet instead you have separate lifecyle events for applets.
You can copy CreationEvent param from above shared example and place it in your applet code. This would automatically call your function with the applet has loaded completely.
Thanks,
Swaroop
Wow this takes me back....
You can do something like this for your param:
<PARAM NAME="CreationEvent" VALUE="appletReady" />
Then define your function like this:
function appletReady(){
//start doing stuff
}
If you have multiple applets, say 3, I think you can do something like this:
var readyCnt = 0;
function appletReady(){
readyCnt++;
if(readyCnt===3){
//start doing stuff
}
}
Overall I would recommend avoiding all applet usage if possible tho. They just create too many headaches.
Hi Tibor,
Christian Just answerd how you can use the function call.
Ans for your question, NO there is no interrelation between applets loading, applet 3 can load before applet 1 sometimes as vice-versa. Keep a flag, and chain it if it's a must to check if applet has loaded completely.
Thanks,
Swaroop
User | Count |
---|---|
11 | |
6 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.