[T4.1.3] Problems using ajax with Tapestry

2007-11-24 Thread Henrik Schlanbusch
Hi I have problem with my ajax code. I try
to run the code in my tapestry app, but 
when I read the results in firebug from my calls, I get an
empty string  from the tapestry servlet, 
when I indeed expect to see a well formed html
page. I have tried to run the url that I call
directly through the browser, which turns out to 
run just fine, but it seems that when i use the
prototype Ajax.Updater it will not load the html content??

My script looks like this:

function getHTML() {
dojo.log.info(Running getHTML);
var url = 'span jwcid=@Insert value=ognl:url raw=ognl:true/';

var myAjax = new Ajax.Updater(
'span jwcid=@Insert value=ognl:returnid/',
url,
{
method: 'get',
onFailure: reportError,
asynchronous: false, 
evalScripts: true,
onComplete: showResponse

});
 }

I have verified that the url that is inserted into the url variable
is valid, and the script also replaces the placeholder that is 
correctly inserted. But as told above, it seems that the
tapestry servlet returns an empty string  from the call. 

Is there a filter or something that prevents tapestry from
responding properly to the Ajax.Updater calls? Is this a
configuration issue for me? I am pretty sure people
have been using this technique before :-)

I know I could do something similar with the built in 
tapestry components, but I have to build some specially 
tailored ajaxstuff here to make my customers happy :-)

Henrik


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T4.1.3] Problems using ajax with Tapestry

2007-11-24 Thread Andreas Andreou
But, what happens when you GET that url directly? Do you see anything returned?

On Nov 24, 2007 12:17 PM, Henrik Schlanbusch [EMAIL PROTECTED] wrote:
 Hi I have problem with my ajax code. I try
 to run the code in my tapestry app, but
 when I read the results in firebug from my calls, I get an
 empty string  from the tapestry servlet,
 when I indeed expect to see a well formed html
 page. I have tried to run the url that I call
 directly through the browser, which turns out to
 run just fine, but it seems that when i use the
 prototype Ajax.Updater it will not load the html content??

 My script looks like this:

 function getHTML() {
 dojo.log.info(Running getHTML);
 var url = 'span jwcid=@Insert value=ognl:url raw=ognl:true/';

 var myAjax = new Ajax.Updater(
 'span jwcid=@Insert value=ognl:returnid/',
 url,
 {
 method: 'get',
 onFailure: reportError,
 asynchronous: false,
 evalScripts: true,
 onComplete: showResponse

 });
  }

 I have verified that the url that is inserted into the url variable
 is valid, and the script also replaces the placeholder that is
 correctly inserted. But as told above, it seems that the
 tapestry servlet returns an empty string  from the call.

 Is there a filter or something that prevents tapestry from
 responding properly to the Ajax.Updater calls? Is this a
 configuration issue for me? I am pretty sure people
 have been using this technique before :-)

 I know I could do something similar with the built in
 tapestry components, but I have to build some specially
 tailored ajaxstuff here to make my customers happy :-)

 Henrik


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T4.1.3] Problems using ajax with Tapestry

2007-11-24 Thread Henrik Schlanbusch
Andreas Andreou andreoua at gmail.com writes:

 
 But, what happens when you GET that url directly? Do you see anything 
 returned?

Yes, I get the full page as I expect it to be loadede through the ajax call. 

I can even see - when I try to load through the AjaxUploader - that the page I
want to load is rendered. I log out a message in the target page
prepareForRender method, that assures me that in fact tapestry creates the page
on the server side. I just do not get the page returned to the client. 



Henrik


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T4.1.3] Problems using ajax with Tapestry

2007-11-24 Thread andyhot

Ok - i haven't really used prototype in Tapestry, but i took a quick look
at PrototypeResponseContributorImpl in org.apache.tapestry.services.impl
and it looks like that ResponseBuilder overrides the default one if it finds
X-Prototype-Version
in the request headers...

So, assuming that prototype adds that by default, it may explain things...
Is it possible to configure your call not to include that header?


Henrik Schlanbusch wrote:

Andreas Andreou andreoua at gmail.com writes:

  

But, what happens when you GET that url directly? Do you see anything returned?



Yes, I get the full page as I expect it to be loadede through the ajax call. 


I can even see - when I try to load through the AjaxUploader - that the page I
want to load is rendered. I log out a message in the target page
prepareForRender method, that assures me that in fact tapestry creates the page
on the server side. I just do not get the page returned to the client. 




Henrik


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]