myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davide Bonicelli" <dado...@gmail.com>
Subject [Trinidad] Problem invoking "queue.sendRequest" from Javascript API in IE7
Date Tue, 04 Mar 2008 17:14:58 GMT
Hi all,
   I'm trying to invoke the sendRequest() method from the Javascript
Trinidad API.
Here is an example of the code I'm using for testing purpose:

[code]
function doAjax(){
 var queue = TrPage.getInstance().getRequestQueue();
 queue.sendRequest(null, this.myCompletionMethod,
        "http://myhost/faces/ajaxReceive.xhtml?foo=bar");
}

function myCompletionMethod(evt)
{
       if(evt.getStatus()==TrXMLRequestEvent.STATUS_COMPLETE)
           alert('Ajax completed!');
}
[/code]

If I invoke the script from Firefox (2.0.0.12) everything works fine and I
can run it as many times as I want.
However, when I invoke the script from IE7 it is executed correctly only the
first time and the subsequent ones the AJAX method is not invoked at all.
Am I doing something wrong or there's a problem with IE7 and the Javascript
API?

Another question: I need to use the sendRequest() method duringthe  "
window.onunload" event handling and everything works fine in Firefox (it
simply doesn't run the code in the callback method), but IE7 behaves like
before: the callback method is executed, but the script is executed only one
time per browser session. This when I run the script in a very simple test
scenario.
When instead I invoke sendRequest() during window.onunload in my
application, I get the following javascript error:

  <chrome://firebug/content/panel.html#>
  <chrome://firebug/content/panel.html#>
 TrXMLRequest is not defined
if(a96!=TrXMLRequest.COMPLETED)
Common1_0_6.js (line 10484)
TrXMLRequest is not defined
if(a96!=TrXMLRequest.COMPLETED)
Common1_0_6.js (line 10484)
TrXMLRequest is not defined
if(a96!=TrXMLRequest.COMPLETED)
Common1_0_6.js (line 10484)

This doesn't affect Firefox at all, but do I'd like to remove this error:
any idea on what's wrong?

Thanks
Dado

Mime
View raw message