>> Is there already a way to just retrieve XML error messages and handle
>> them client-side ? This would enable, for example, to have an AJAX
>> client programmed by somebody who doesn't need to know Cocoon & CForms
>> inside-out, as long as he adheres to a well-defined interface. (He'd
>> call CForms like he would call a webservice).
>>
>>
>
> Interesting thoughts. Actually, this could be a special rendering of
> error messages in the styling xsl that would do some javascript
> callbacks in the client rather than updating the page. Is this what
> you meant?
Yes, or to put it in pseudo code:
<map:match pattern="validate-form1">
<map:generate type="form-validation">
<map:parameter name="form" value="forms/form1.xml" /> <!-- form
def. -->
<map:parameter name="widget"
value="{request-param:cocoon-widget}" /> <!-- widget id -->
<!-- widget value(s) somehow parsed from request automatically -->
</map:generate>
<!-- at this stage, i'd have the ft:validation-error tags from the
validated widget -->
<map:transform src="stylesheets/formerror2javascriptcallback.xsl" />
<map:transform type="i18n" />
<map:serialize />
</map:match>
Instead of the callback, one might also render a widget replacement, a
simple text error message,
a "style=" attribute for the widget in question, ...
In the case of multi-widget dependencies, one might submit an arbitrary
subset of widgets, or the
entire form, to this generator.
This would decouple widget validation from flowscript, providing an
orthogonal way of validation
according to the form definition.
Regards,
Johannes
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]