You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Henrik Schlanbusch <he...@enovate.no> on 2007/11/24 11:17:23 UTC

[T4.1.3] Problems using ajax with Tapestry

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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


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

Posted by Henrik Schlanbusch <he...@enovate.no>.
Andy, thanks soooo much, that did the trick. I fixed the prototype.js file not
to include the X-Prototype-Version in the header, and swoooosh the file appeared
as it should. I cannot thank you enough


Best wishes
Henrik


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


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

Posted by andyhot <an...@di.uoa.gr>.
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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


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

Posted by Henrik Schlanbusch <he...@enovate.no>.
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


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

Posted by Andreas Andreou <an...@gmail.com>.
But, what happens when you GET that url directly? Do you see anything returned?

On Nov 24, 2007 12:17 PM, Henrik Schlanbusch <he...@enovate.no> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org