Michael Waluk wrote:
Hi,
I haven't dug too deep on this but noticed that when a component is
rendered in response to an AjaxDirectLink the AjaxWebRequest is found
in the cycle, but it seems to disappear when submitting an AjaxForm.
I know it is set into the cycle in AjaxDirectServiceImpl's service
either way, but for forms it disappears.
I use code like the following (have seen it in some tacos components)
in my rendercomponent method to determine if the request is normal or
ajax..
boolean ajaxRequest = false;
AjaxWebRequest ajaxr =
(AjaxWebRequest)cycle.getAttribute(AjaxWebRequest.AJAX_REQUEST);
if (ajaxr != null && ajaxr.isValidRequest())
ajaxRequest = true;
What is a better way to determine that is reliable for both form
submissions and links?
Thanks for any help,
Michael
It's better to inject the AjaxWebRequest, using Hivemind. Nevertheless,
I fixed this bug today:
http://tacoscomponents.jot.com/BugReporter/Bug84
It should be in the public CVS in a while.
Check the current source code (in AjaxSubmit) to see how the
AjaxWebRequest can be injected. Or, the code you put above can be
shortened to:
AjaxWebRequest ajaxRequest = ScriptUtils.getAjaxRequest(cycle);
boolean ajaxRequest = (ajaxRequest != null && ajaxRequest.isValidRequest());
but after CVS is updated.
--
Ing. Leonardo Quijano Vincenzi
DTQ Software
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Tacos-devel mailing list
Tacos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tacos-devel