Re: Injection javascript code - AjaxResponseRenderer vs JavaScriptSupport

2013-06-13 Thread Paul Stanton
Just further to this, here is the utility service I use to wrap JS calls from any context (which helps leverage re-usable code). ie using this avoids having to change between AjaxResponseRenderer and JavaScriptSupport depending on the context (XHR/phase). public class JavaScriptHelperImpl imp

Re: Injection javascript code - AjaxResponseRenderer vs JavaScriptSupport

2012-07-15 Thread Paul Stanton
As Lance said, you need to use JavascriptSupport when preparing a non-ajax response, and AjaxResponseRenderer when you are... if (request.isXHR()) { // use AjaxResponseRenderer } else { // use JavascriptSupport } however if the bug (https://issues.apache.org/jira/browse/TAP5-1870 ) aff

Re: Injection javascript code - AjaxResponseRenderer vs JavaScriptSupport

2012-07-15 Thread bhorvat
Hi Paul, Hm... yea this appears to be the same problem that I am having. The set method gets called but the run part doesn't. In other words the methods is called and the callback is added to the AjaxResponseRenderer but it is never triggered (the add script part in the run method that is) -- Vie

Re: Injection javascript code - AjaxResponseRenderer vs JavaScriptSupport

2012-07-15 Thread bhorvat
My scenario is that I have a link (there is zone parameter) that refreshes the zone. Now in this zone there is a component in which there is a method @AfterRender public void set(){ ajaxResponseRenderer.addCallback(new JavaScriptCallback() { @Override

Re: Injection javascript code - AjaxResponseRenderer vs JavaScriptSupport

2012-07-15 Thread Lance Java
AjaxResponseRenderer is only available for Ajax requests. JavaScriptSupport is available for non Ajax requests. I'm guessing either you didn't specify a zone on your eventlink / form or you have a JavaScript error on your page (meaning tapestry can't decorate your links with Ajax actions) On Sund

Re: Injection javascript code - AjaxResponseRenderer vs JavaScriptSupport

2012-07-15 Thread Paul Stanton
i'm assuming this 'afterrender' is within a component which is within a zone being updated via an ajax request/response? if so, is this the same as the issue i logged?: https://issues.apache.org/jira/browse/TAP5-1870 does your "set" method get called at all? On 15/07/2012 10:33 AM, bhorvat wr