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 finding myself
adding that to every single method that returns zone.getBody() makes me
think that getBody() could make the distinction internally.
Now, I realize that this is quite intrusive to the Zone component, but it
does keep my event handler code a lot cleaner!
I experimentally created the component transformer shown below, which does
the work for me.
Would you advice against and/or could you suggest a better abstraction for
doing this?
Also, should I call invocation.proceed() even in the non-XHR case to ensure
other method advices be run?
Thanks for your input!
Best regards,
Jacob
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/XHR-isXHR-shortcut-tp3353416p5713607.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]