Re: @XHR : isXHR shortcut

2012-06-04 Thread jpoder
Hi, I'm looking for a general solution to avoid constructs like this in all my event handlers: Object onMyAjaxEventHandler(){ do_some_processing(); if(request.isXHR()){ return zone.getBody(); } return null; } Taha's @XHR annotation is a step in the right direction, but

RE: @XHR : isXHR shortcut

2012-06-04 Thread Poder, Jacob
Hmm, apparently the code was filtered out but is included here: http://tapestry.1045711.n5.nabble.com/XHR-isXHR-shortcut-tp3353416p5713607.html I'll try posting it again: // Code begin public class ZoneWorker implements ComponentClassTransformWorker2 { protected Request request;

Re: @XHR : isXHR shortcut

2011-01-24 Thread Taha Hafeez
Hi The reason the body is invoked is because there may be some logic which must be executed even if the call is not ajax. The worker only ensures that if javascript is disabled the call may still go through. Regarding the return value, i modified the code to include cases you had pointed out.

Re: @XHR : isXHR shortcut

2011-01-23 Thread Taha Hafeez
Thanks Thiago You are absolutely right, in case of void it can throw an exception, i will modify it and put it in my examples at http://code.google.com/p/tapestry-addons/ regards Taha On Sun, Jan 23, 2011 at 5:24 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Sun, 23 Jan

Re: @XHR : isXHR shortcut

2011-01-23 Thread Thiago H. de Paula Figueiredo
On Sun, 23 Jan 2011 10:01:17 -0200, Taha Hafeez tawus.tapes...@gmail.com wrote: Thanks Thiago :) You are absolutely right, in case of void it can throw an exception, i will modify it and put it in my examples at http://code.google.com/p/tapestry-addons/ Why not Apache Extras

Re: @XHR : isXHR shortcut

2011-01-23 Thread Howard Lewis Ship
I suppose this is useful, but what it does is to invoke the method regardless of whether XHR is true or not, and then throw away the result. It probably should be: if (request.isXHR()) { invocation.proceed(); } I'm not sure what the else should be ... probably return null/0/false