cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: Adding a global validation message to a form?
Date Fri, 28 May 2004 10:14:09 GMT
On 28.05.2004 11:24, Upayavira wrote:

>>> re: adding form-level validation error messageS.
>>>
>>> This is a feature I would use as well. In our applications, we often
>>> display the list of errors at the top of the form and then each field
>>> in error is styled in red and the label gets an *.
>>>
>>> This is something Struts offers *wink* *wink*.  See <html:errors> at
>>> http://jakarta.apache.org/struts/userGuide/struts-html.html#errors
>>
>> That's what fi:validation-errors is about.
> 
> Great. But how do you set that using Java code? E.g. wanting to set it 
> to say "Your user/pass was incorrect"?

I know it only from the stylesheets:
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/forms/samples/resources/forms-field-styling.xsl?annotate=1.10#480

The only reference in the doc I found is here:
http://cocoon.apache.org/2.1/userdocs/forms/xslt.html#fi%3Avalidation-errors

The template collects all fi:validation-messages, so if the 
validation-errors element is only available in the template, you must 
place the message on a widget.

For placing messages from Java code the fd:message seems to be the 
better choice.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message