You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark H <ma...@markhorgan.com> on 2004/05/26 18:51:09 UTC

Adding a global validation message to a form?

Can anybody tell me how I would add a global validation message to a form
(cocoon forms) in version 2.1.5?



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


Re: Adding a global validation message to a form?

Posted by Joerg Heinicke <jo...@gmx.de>.
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


Re: Adding a global validation message to a form?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 01.06.2004 23:43, Bruno Dumon wrote:

>>>Once we have this kind of functionality, we can drop the fd:messages
>>>widget which was introduced as a temporary solution.
>>>
>>>OTOH, from monitoring the users list, it seems a fd:message widget
>>>(singular) would be useful since many users are now using the fd:output
>>>widget for outputting messages (and then need to do special things to
>>>get i18n working for that).
>>
>>Hmm, not every form message must be necessarily an error, maybe they are 
>>just info (without the need for a failing validation). So we need a 
>>mixture of fd:message and the described functionality for the form 
>>itself. Maybe even this makes the fd:message not superfluous because the 
>>messages can be placed more fine-grained with it.
> 
> 
> you mean fd:messages ? (with the 's')

Oh, you make a difference between singular and plural. Then I have to 
re-read the last sections ... ah, there is also a "singular" in parantheses.

At the moment we have fd:messages. You can have many of them and add one 
or more messages. So, yes, I meant fd:messages. But what's the use case 
of having fd:message additionally or as replacement if fd:messages is 
dropped?

Joerg

Re: Adding a global validation message to a form?

Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2004-06-01 at 23:02, Joerg Heinicke wrote:
> On 29.05.2004 11:14, Bruno Dumon wrote:
> 
> >>Moving this to dev list. Find the original thread at 
> >>http://marc.theaimsgroup.com/?t=108559109700004&r=1&w=4.
> 
> >>>I'm not sure if this is a good
> >>>solution, since those messages are not specifically recognized as being
> >>>validation errors, and so this wouldn't work together with
> >>>fi:validation-errors. Maybe the best would be to allow adding validation
> >>>errors (multiple ones) on the form itself.
> >>
> >>The form itself becomes ValidationErrorAware? I searched for it when 
> >>thinking about a solution, but unfortunately the form is not 
> >>implementing the interface.
> > 
> > 
> > No, I would rather have a method like addValidationError on the form,
> > not setValidationError. One global validation error message seems to
> > limitting to me.
> 
> I agree.
> 
> >>>fi:validation-errors would
> >>>then better be replaced with a ft:validation-errors (which can crawl the
> >>>widget tree), since otherwise it wouldn't find the errors attached to
> >>>the form.
> >>
> >>Hmm, I guess it is also possible to add a fi:validation-message to the 
> >>form widget as it is done for all other widgets. It must be possible to 
> >>differ between form widget (= global) validation errors, collected 
> >>"somewhere" and widget specific errors. In other words I do not want to 
> >>be forced to collect all errors at one place just because of using 
> >>ft:validation-errors for the global errors.
> > 
> > This behaviour could be made configurable via an attribute on the
> > element:
> > 
> > <ft:form-errors all="true|false"/>
> 
> fi:validation-errors vs. ft:form-errors - was this renaming intended?

yes, since this tag would retrieve the errors of the form, which can be
multiple ones, and have the extra functionality of the 'all' attribute.
However, maybe this kind of functionality would potentially be useful
for all types of container widgets. Need to think some more about it.

> 
> > all=false would give only the errors added directly to the form, while
> > all=true would give all errors from all widgets (including those added
> > to the form).
> > 
> > Once we have this kind of functionality, we can drop the fd:messages
> > widget which was introduced as a temporary solution.
> > 
> > OTOH, from monitoring the users list, it seems a fd:message widget
> > (singular) would be useful since many users are now using the fd:output
> > widget for outputting messages (and then need to do special things to
> > get i18n working for that).
> 
> Hmm, not every form message must be necessarily an error, maybe they are 
> just info (without the need for a failing validation). So we need a 
> mixture of fd:message and the described functionality for the form 
> itself. Maybe even this makes the fd:message not superfluous because the 
> messages can be placed more fine-grained with it.

you mean fd:messages ? (with the 's')

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: Adding a global validation message to a form?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 29.05.2004 11:14, Bruno Dumon wrote:

>>Moving this to dev list. Find the original thread at 
>>http://marc.theaimsgroup.com/?t=108559109700004&r=1&w=4.

>>>I'm not sure if this is a good
>>>solution, since those messages are not specifically recognized as being
>>>validation errors, and so this wouldn't work together with
>>>fi:validation-errors. Maybe the best would be to allow adding validation
>>>errors (multiple ones) on the form itself.
>>
>>The form itself becomes ValidationErrorAware? I searched for it when 
>>thinking about a solution, but unfortunately the form is not 
>>implementing the interface.
> 
> 
> No, I would rather have a method like addValidationError on the form,
> not setValidationError. One global validation error message seems to
> limitting to me.

I agree.

>>>fi:validation-errors would
>>>then better be replaced with a ft:validation-errors (which can crawl the
>>>widget tree), since otherwise it wouldn't find the errors attached to
>>>the form.
>>
>>Hmm, I guess it is also possible to add a fi:validation-message to the 
>>form widget as it is done for all other widgets. It must be possible to 
>>differ between form widget (= global) validation errors, collected 
>>"somewhere" and widget specific errors. In other words I do not want to 
>>be forced to collect all errors at one place just because of using 
>>ft:validation-errors for the global errors.
> 
> This behaviour could be made configurable via an attribute on the
> element:
> 
> <ft:form-errors all="true|false"/>

fi:validation-errors vs. ft:form-errors - was this renaming intended?

> all=false would give only the errors added directly to the form, while
> all=true would give all errors from all widgets (including those added
> to the form).
> 
> Once we have this kind of functionality, we can drop the fd:messages
> widget which was introduced as a temporary solution.
> 
> OTOH, from monitoring the users list, it seems a fd:message widget
> (singular) would be useful since many users are now using the fd:output
> widget for outputting messages (and then need to do special things to
> get i18n working for that).

Hmm, not every form message must be necessarily an error, maybe they are 
just info (without the need for a failing validation). So we need a 
mixture of fd:message and the described functionality for the form 
itself. Maybe even this makes the fd:message not superfluous because the 
messages can be placed more fine-grained with it.

Joerg

Re: Adding a global validation message to a form?

Posted by Bruno Dumon <br...@outerthought.org>.
On Sat, 2004-05-29 at 13:13, Upayavira wrote:
> Bruno Dumon wrote:
> 
> >On Fri, 2004-05-28 at 23:58, Joerg Heinicke wrote:
> >  
> >
> >>Moving this to dev list. Find the original thread at 
> >>http://marc.theaimsgroup.com/?t=108559109700004&r=1&w=4.
> >>
> >>On 28.05.2004 20:13, Bruno Dumon wrote:
> >>
> >>    
> >>
> >>>I'm not sure if this is a good
> >>>solution, since those messages are not specifically recognized as being
> >>>validation errors, and so this wouldn't work together with
> >>>fi:validation-errors. Maybe the best would be to allow adding validation
> >>>errors (multiple ones) on the form itself.
> >>>      
> >>>
> >>The form itself becomes ValidationErrorAware? I searched for it when 
> >>thinking about a solution, but unfortunately the form is not 
> >>implementing the interface.
> >>    
> >>
> >
> >No, I would rather have a method like addValidationError on the form,
> >not setValidationError. One global validation error message seems to
> >limitting to me.
> >  
> >
> At the mo  only want one message but I can see times when multiples 
> might be wanted. So +1 for addValidationError
> 
> >>So +1.
> >>
> >>    
> >>
> >>>fi:validation-errors would
> >>>then better be replaced with a ft:validation-errors (which can crawl the
> >>>widget tree), since otherwise it wouldn't find the errors attached to
> >>>the form.
> >>>      
> >>>
> >>Hmm, I guess it is also possible to add a fi:validation-message to the 
> >>form widget as it is done for all other widgets. It must be possible to 
> >>differ between form widget (= global) validation errors, collected 
> >>"somewhere" and widget specific errors. In other words I do not want to 
> >>be forced to collect all errors at one place just because of using 
> >>ft:validation-errors for the global errors.
> >>    
> >>
> >
> >This behaviour could be made configurable via an attribute on the
> >element:
> >
> ><ft:form-errors all="true|false"/>
> >
> >all=false would give only the errors added directly to the form, while
> >all=true would give all errors from all widgets (including those added
> >to the form).
> >  
> >
> Sounds very useful.
> 
> >Once we have this kind of functionality, we can drop the fd:messages
> >widget which was introduced as a temporary solution.
> >
> >OTOH, from monitoring the users list, it seems a fd:message widget
> >(singular) would be useful since many users are now using the fd:output
> >widget for outputting messages (and then need to do special things to
> >get i18n working for that).
> >  
> >
> +1 from me! Except I wouldn't know where to start to implement it!

Just open the class Form, add an instance member to it to hold the list
of validation errors, add addValidationError(...) and
getValidationErrors() methods.

Then on the template side, open the EffectWidgetReplacingPipe, react to
the ft:form-errors element, and do what needs to be done (ie call
getValidationErrors on the form object and stream some sax events for
them). You can skip the all=true case for now if you don't need it, but
it shouldn't be too hard either.

But I'd wait a day or two in case anybody finds the above a bad idea.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: Adding a global validation message to a form?

Posted by Upayavira <uv...@upaya.co.uk>.
Bruno Dumon wrote:

>On Fri, 2004-05-28 at 23:58, Joerg Heinicke wrote:
>  
>
>>Moving this to dev list. Find the original thread at 
>>http://marc.theaimsgroup.com/?t=108559109700004&r=1&w=4.
>>
>>On 28.05.2004 20:13, Bruno Dumon wrote:
>>
>>    
>>
>>>I'm not sure if this is a good
>>>solution, since those messages are not specifically recognized as being
>>>validation errors, and so this wouldn't work together with
>>>fi:validation-errors. Maybe the best would be to allow adding validation
>>>errors (multiple ones) on the form itself.
>>>      
>>>
>>The form itself becomes ValidationErrorAware? I searched for it when 
>>thinking about a solution, but unfortunately the form is not 
>>implementing the interface.
>>    
>>
>
>No, I would rather have a method like addValidationError on the form,
>not setValidationError. One global validation error message seems to
>limitting to me.
>  
>
At the mo  only want one message but I can see times when multiples 
might be wanted. So +1 for addValidationError

>>So +1.
>>
>>    
>>
>>>fi:validation-errors would
>>>then better be replaced with a ft:validation-errors (which can crawl the
>>>widget tree), since otherwise it wouldn't find the errors attached to
>>>the form.
>>>      
>>>
>>Hmm, I guess it is also possible to add a fi:validation-message to the 
>>form widget as it is done for all other widgets. It must be possible to 
>>differ between form widget (= global) validation errors, collected 
>>"somewhere" and widget specific errors. In other words I do not want to 
>>be forced to collect all errors at one place just because of using 
>>ft:validation-errors for the global errors.
>>    
>>
>
>This behaviour could be made configurable via an attribute on the
>element:
>
><ft:form-errors all="true|false"/>
>
>all=false would give only the errors added directly to the form, while
>all=true would give all errors from all widgets (including those added
>to the form).
>  
>
Sounds very useful.

>Once we have this kind of functionality, we can drop the fd:messages
>widget which was introduced as a temporary solution.
>
>OTOH, from monitoring the users list, it seems a fd:message widget
>(singular) would be useful since many users are now using the fd:output
>widget for outputting messages (and then need to do special things to
>get i18n working for that).
>  
>
+1 from me! Except I wouldn't know where to start to implement it!

Regards, Upayavira



Re: Adding a global validation message to a form?

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2004-05-28 at 23:58, Joerg Heinicke wrote:
> Moving this to dev list. Find the original thread at 
> http://marc.theaimsgroup.com/?t=108559109700004&r=1&w=4.
> 
> On 28.05.2004 20:13, Bruno Dumon wrote:
> 
> > I'm not sure if this is a good
> > solution, since those messages are not specifically recognized as being
> > validation errors, and so this wouldn't work together with
> > fi:validation-errors. Maybe the best would be to allow adding validation
> > errors (multiple ones) on the form itself.
> 
> The form itself becomes ValidationErrorAware? I searched for it when 
> thinking about a solution, but unfortunately the form is not 
> implementing the interface.

No, I would rather have a method like addValidationError on the form,
not setValidationError. One global validation error message seems to
limitting to me.

> 
> So +1.
> 
> > fi:validation-errors would
> > then better be replaced with a ft:validation-errors (which can crawl the
> > widget tree), since otherwise it wouldn't find the errors attached to
> > the form.
> 
> Hmm, I guess it is also possible to add a fi:validation-message to the 
> form widget as it is done for all other widgets. It must be possible to 
> differ between form widget (= global) validation errors, collected 
> "somewhere" and widget specific errors. In other words I do not want to 
> be forced to collect all errors at one place just because of using 
> ft:validation-errors for the global errors.

This behaviour could be made configurable via an attribute on the
element:

<ft:form-errors all="true|false"/>

all=false would give only the errors added directly to the form, while
all=true would give all errors from all widgets (including those added
to the form).

Once we have this kind of functionality, we can drop the fd:messages
widget which was introduced as a temporary solution.

OTOH, from monitoring the users list, it seems a fd:message widget
(singular) would be useful since many users are now using the fd:output
widget for outputting messages (and then need to do special things to
get i18n working for that).

> 
> But +1 for the idea in general.
> 
> Joerg
-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Re: Adding a global validation message to a form?

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2004-05-28 at 23:58, Joerg Heinicke wrote:
> Moving this to dev list. Find the original thread at 
> http://marc.theaimsgroup.com/?t=108559109700004&r=1&w=4.
> 
> On 28.05.2004 20:13, Bruno Dumon wrote:
> 
> > I'm not sure if this is a good
> > solution, since those messages are not specifically recognized as being
> > validation errors, and so this wouldn't work together with
> > fi:validation-errors. Maybe the best would be to allow adding validation
> > errors (multiple ones) on the form itself.
> 
> The form itself becomes ValidationErrorAware? I searched for it when 
> thinking about a solution, but unfortunately the form is not 
> implementing the interface.

No, I would rather have a method like addValidationError on the form,
not setValidationError. One global validation error message seems to
limitting to me.

> 
> So +1.
> 
> > fi:validation-errors would
> > then better be replaced with a ft:validation-errors (which can crawl the
> > widget tree), since otherwise it wouldn't find the errors attached to
> > the form.
> 
> Hmm, I guess it is also possible to add a fi:validation-message to the 
> form widget as it is done for all other widgets. It must be possible to 
> differ between form widget (= global) validation errors, collected 
> "somewhere" and widget specific errors. In other words I do not want to 
> be forced to collect all errors at one place just because of using 
> ft:validation-errors for the global errors.

This behaviour could be made configurable via an attribute on the
element:

<ft:form-errors all="true|false"/>

all=false would give only the errors added directly to the form, while
all=true would give all errors from all widgets (including those added
to the form).

Once we have this kind of functionality, we can drop the fd:messages
widget which was introduced as a temporary solution.

OTOH, from monitoring the users list, it seems a fd:message widget
(singular) would be useful since many users are now using the fd:output
widget for outputting messages (and then need to do special things to
get i18n working for that).

> 
> But +1 for the idea in general.
> 
> Joerg
-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: Adding a global validation message to a form?

Posted by Joerg Heinicke <jo...@gmx.de>.
Moving this to dev list. Find the original thread at 
http://marc.theaimsgroup.com/?t=108559109700004&r=1&w=4.

On 28.05.2004 20:13, Bruno Dumon wrote:

> I'm not sure if this is a good
> solution, since those messages are not specifically recognized as being
> validation errors, and so this wouldn't work together with
> fi:validation-errors. Maybe the best would be to allow adding validation
> errors (multiple ones) on the form itself.

The form itself becomes ValidationErrorAware? I searched for it when 
thinking about a solution, but unfortunately the form is not 
implementing the interface.

So +1.

> fi:validation-errors would
> then better be replaced with a ft:validation-errors (which can crawl the
> widget tree), since otherwise it wouldn't find the errors attached to
> the form.

Hmm, I guess it is also possible to add a fi:validation-message to the 
form widget as it is done for all other widgets. It must be possible to 
differ between form widget (= global) validation errors, collected 
"somewhere" and widget specific errors. In other words I do not want to 
be forced to collect all errors at one place just because of using 
ft:validation-errors for the global errors.

But +1 for the idea in general.

Joerg

Re: Adding a global validation message to a form?

Posted by Joerg Heinicke <jo...@gmx.de>.
Moving this to dev list. Find the original thread at 
http://marc.theaimsgroup.com/?t=108559109700004&r=1&w=4.

On 28.05.2004 20:13, Bruno Dumon wrote:

> I'm not sure if this is a good
> solution, since those messages are not specifically recognized as being
> validation errors, and so this wouldn't work together with
> fi:validation-errors. Maybe the best would be to allow adding validation
> errors (multiple ones) on the form itself.

The form itself becomes ValidationErrorAware? I searched for it when 
thinking about a solution, but unfortunately the form is not 
implementing the interface.

So +1.

> fi:validation-errors would
> then better be replaced with a ft:validation-errors (which can crawl the
> widget tree), since otherwise it wouldn't find the errors attached to
> the form.

Hmm, I guess it is also possible to add a fi:validation-message to the 
form widget as it is done for all other widgets. It must be possible to 
differ between form widget (= global) validation errors, collected 
"somewhere" and widget specific errors. In other words I do not want to 
be forced to collect all errors at one place just because of using 
ft:validation-errors for the global errors.

But +1 for the idea in general.

Joerg

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


Re: Adding a global validation message to a form?

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2004-05-28 at 11:24, Upayavira wrote:
> Joerg Heinicke wrote:
> 
> > On 28.05.2004 01:13, Benoit Deshaies 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?

Not. It only collects the validation errors of other widgets, in order
to show them together at one location. And it does that by scanning over
the XML, not over the original widget tree. This makes that if you would
forget to include a widget, you wouldn't see its error either.

>  E.g. wanting to set it 
> to say "Your user/pass was incorrect"?

Validation errors can only be set on widgets implementing the
ValidationErrorAware interface, see the table on
http://cocoon.apache.org/2.1/userdocs/forms/validation.html

This doesn't help you for your case where you need to show a validation
error that is global to the form as a whole.

Alternatively, there is the fd:messages widget. You can add messages to
it by calling addMessage() on it. I'm not sure if this is a good
solution, since those messages are not specifically recognized as being
validation errors, and so this wouldn't work together with
fi:validation-errors. Maybe the best would be to allow adding validation
errors (multiple ones) on the form itself. fi:validation-errors would
then better be replaced with a ft:validation-errors (which can crawl the
widget tree), since otherwise it wouldn't find the errors attached to
the form.

WDYT?

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Re: Adding a global validation message to a form?

Posted by Upayavira <uv...@upaya.co.uk>.
Joerg Heinicke wrote:

> On 28.05.2004 01:13, Benoit Deshaies 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"?

Upayavira



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


Re: Adding a global validation message to a form?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 28.05.2004 01:13, Benoit Deshaies 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.

Joerg

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


Re: Adding a global validation message to a form?

Posted by Benoit Deshaies <bd...@yahoo.com>.
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

Benoit Deshaies



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

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


Re: Adding a global validation message to a form?

Posted by Bruno Dumon <br...@outerthought.org>.
On Thu, 2004-05-27 at 11:12, Upayavira wrote:
> Mark H wrote:
> 
> >>Are you looking for a feature you had in 2.1.4 and you don't find
> >>anymore? If so, what exactly?
> >>    
> >>
> >
> >No, the reason I mentioned 2.1.5 is just to make clear what version of
> >cocoon I'm using since cforms are still in development.
> >
> >Basically what I'm looking for is after some custom validation to be able to
> >add a validation message like "your login details are incorrect" to a form
> >rather than a widget. I've looked through the javadocs but I can't find
> >anything.
> >  
> >
> To expand on this (I'm working with Mark on this), we need, in Java, to 
> do something like form.setValidationMessage("Your login failed") and 
> redisplay the form.

Maybe this feature could be added.

> 
> Do we set up a <fd:message> and set the text on that? Any other ideas?

There is a fd:messages widget.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Re: Adding a global validation message to a form?

Posted by Upayavira <uv...@upaya.co.uk>.
Mark H wrote:

>>Are you looking for a feature you had in 2.1.4 and you don't find
>>anymore? If so, what exactly?
>>    
>>
>
>No, the reason I mentioned 2.1.5 is just to make clear what version of
>cocoon I'm using since cforms are still in development.
>
>Basically what I'm looking for is after some custom validation to be able to
>add a validation message like "your login details are incorrect" to a form
>rather than a widget. I've looked through the javadocs but I can't find
>anything.
>  
>
To expand on this (I'm working with Mark on this), we need, in Java, to 
do something like form.setValidationMessage("Your login failed") and 
redisplay the form.

Do we set up a <fd:message> and set the text on that? Any other ideas?

Upayavira, who's currently undergoing a crash course in CForms and Binding


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


Re: Adding a global validation message to a form?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 26.05.2004 22:06, Mark H wrote:

>> Can anybody tell me how I would add a global validation message to
>> a form (cocoon forms) in version 2.1.5?

> Basically what I'm looking for is after some custom validation to be
> able to add a validation message like "your login details are
> incorrect" to a form rather than a widget. I've looked through the
> javadocs but I can't find anything.

There is a template for fi:messages and one for fi:validation-errors in 
the stylesheet:
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/forms/samples/resources/forms-field-styling.xsl?annotate=1.8#466

 From the semantical POV the second would probably apply better, but I 
do not really know how it goes into the form. Just a 
ft:validation-errors in the template?

The first on has its counterpart in the form definition and is itself a 
widget: http://cocoon.apache.org/2.1/userdocs/forms/widget_messages.html 
(nearly no docu available).

Joerg

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


RE: Adding a global validation message to a form?

Posted by Mark H <ma...@markhorgan.com>.
>Are you looking for a feature you had in 2.1.4 and you don't find
>anymore? If so, what exactly?

No, the reason I mentioned 2.1.5 is just to make clear what version of
cocoon I'm using since cforms are still in development.

Basically what I'm looking for is after some custom validation to be able to
add a validation message like "your login details are incorrect" to a form
rather than a widget. I've looked through the javadocs but I can't find
anything.

Mark

-----Original Message-----
From: users-return-68042-mailinglists=markhorgan.com@cocoon.apache.org
[mailto:users-return-68042-mailinglists=markhorgan.com@cocoon.apache.org
]On Behalf Of Bruno Dumon
Sent: 26 May 2004 19:15
To: users@cocoon.apache.org
Subject: Re: Adding a global validation message to a form?


On Wed, 2004-05-26 at 18:51, Mark H wrote:
> Can anybody tell me how I would add a global validation message to a form
> (cocoon forms) in version 2.1.5?

Are you looking for a feature you had in 2.1.4 and you don't find
anymore? If so, what exactly?

--
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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




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


Re: Adding a global validation message to a form?

Posted by Bruno Dumon <br...@outerthought.org>.
On Wed, 2004-05-26 at 18:51, Mark H wrote:
> Can anybody tell me how I would add a global validation message to a form
> (cocoon forms) in version 2.1.5?

Are you looking for a feature you had in 2.1.4 and you don't find
anymore? If so, what exactly?

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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