[T4] - Tapestry.bind basic Ajax example

2007-10-19 Thread Loïc Talbot
Hi there,

I'm trying to do an XHR request using the same method as "@DirectLink"
component.

Here is the code:


var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
var content;
function SendAjaxRequest() {
tapestry.bind
("/PhoneBook/app?component=%24DirectLink&page=majax&service=direct");
tapestry.load(xmlDoc);
content = xmlDoc.responseXML;
}


 click here


The server-side component does work when called when using DirectLink, but
when clicking the link as coded above it doesn't.
1./ in IE7 it simply doesn't work but the page is displayed
2./ in Firefox it doesn't display the whole page and Firebug sends an error
message:"uncaught exception: [Exception...' "Component returned failure
code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [
nsIXMLHttpRequest.setRequestHeader]"

I know, I know there must be something I have misunderstood but I am a bit
lost.

I don't want to use DirectLink because the result of the XHR must be used in
another javascript function.

Any help/remarks ?
Thanks
Loïc


[T4] - Tapestry.bind basic Ajax example

2007-10-18 Thread Loïc Talbot
Hi there,

I 'd like to implement a "DirectLink-like" function using tapestry.bind &
load functions in order to use the result in other Javascript functions.

Here is my simple example:


var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
var content;
function SendAjaxRequest() {
tapestry.bind
("/PhoneBook/app?component=%24DirectLink&page=majax&service=direct");
tapestry.load(xmlDoc);
content = xmlDoc.responseXML;
}


click here



The server-side Java component does work with @DirectLink. In the above
lines it seems no connection to the server is done when clicking plus there
is a strange Firebug error message :"Component returned failure code:
0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.setRequestHeader]"
nsresult: "0x80070057..."  it does not appear in IE7.

Of course I should use DirectLink you may say but I think I cannot because I
want to reuse the result of the Ajax request into another Javascript
function before.

Any hint/link/remark appreciated !
Thanks!
Loïc