Home
TeamSite
calling callServer() with in JavaScript
sspopuri
I have a situation where I need to call callServer() from with JavaScript.
I am trying to achieve this as following:
<script language='Javascript'>
var api = parent.getScriptFrame();
...
function handle_selection()
{
...
var param = new Object();
param.mimetype = "TEST";
param.itype = "House";
param.value = "TEST1";
param.workarea = "area";
api.IWDatacapture.callServer('Ex_UpdateDealers.ipl','',true);
...
}
But this is not working! Any one has any idea?
Thanks in advance
</script>
Find more posts tagged with
Comments
Migrateduser
I am not sure but you man need to pass the full URL of the script, probably
'/iw-bin/Ex_UpdateDealers.ipl'
Of course this belongs in the templating forum.
sspopuri
I did that but no luck :-(
Migrateduser
You are checking the apache error and access logs and seeing no hits on anything matching your .ipl file name? Did you put an alert right before the callServer to ensure your code is reaching that point?
sspopuri
Yes I do have an alert right before the callServer and the see the alert message.
Any way, I get the following error message:
"Exception [netscape.JavaScript.JSException]: Failuer to evaluate handle_selection();
The status bar of error message window says "Java Applet window"
Edited by sspopuri on 11/19/03 01:47 PM (server time).
Migrateduser
Can you post your .ipl and DCT/.js? Otherwise I think you have to file a case with support - actually you might just start there (your .ipl is not creating an applet is it?).
jbonifaci
Pretty sure you need the url and you don't need the api part, try this:
IWDatacapture.callServer('
http://<hostname>/iw-bin/Ex_UpdateDealers.ipl',param,true)
;
sspopuri
Yes it does create applet and once I am done with my applet, I call a javaScript function in which I am trying to make a callServer call.
Migrateduser
Then it sounds like it's calling your script and there's a problem with the script, maybe because it's trying to render an applet in a hidden window. Why not use window.open (and pass parameters on the URL instead of in a javascript object) instead of calllServer and window.opener.top instead of window.opener in the generated HTML - that could at least help you debug. I don't think this has anything to do with teamsite.