Quoin Developers wrote:
Why do you need such flexibility?
Concretely, I was running in to
http://issues.apache.org/jira/browse/COCOON-1570 and realized that I
could get what I needed by simply switching out of ajax mode (plus
scrolling back up to the top of the page).
And then I discovered that there was no simple way to switch out of
ajax mode. The first way I discovered to switch out of ajax mode was
to embellish onclick with "cocoon.forms.ajax=false;
forms_submitForm(this, '[EMAIL PROTECTED]'); return false". I could do that with
fi:style, but it was clunky. I tried to embellish the onclick and
onsubmit in the xsl, but that still felt clunky, so my approach
evolved a bit.
Bottom line, in my current application, I have certain page widgets
that benefit from ajax updates to the form, however, the final
form-level validation is simpler if i can switch out of ajax mode.
This patch lets me do that. It felt useful, but I could be convinced
otherwise.
It /may/ be that once I fix 1570, that 1774 will be less critical, but
I don't like that AJAX is all or nothing, as to me it feels a bit like
it should be a per-widget decision.
I see. Well, I'm not really happy with adding more complexity by
allowing individual widgets to specify Ajax mode, but I understand the
issue.
Also, I realize that not all widgets nor all stylings allow Ajax mode,
and this <fi:validation-errors> (which I never used myself) shows it.
So let's go for it, and have the default mode defined on the form (with
the "ajax" attribute) and allow it to be overriden on widgets.
Now this orverriding should be limited to _terminal_ widgets (i.e.
inputs and buttons) and not be considered hierarchically (e.g. adding
ajax="false" on a repeater), in order to keep things as simple as they
can be.
Sylvain
--
Sylvain Wallez Anyware Technologies
http://bluxte.net http://www.anyware-tech.com
Apache Software Foundation Member Research & Technology Director