You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2004/05/28 23:58:58 UTC
Re: Adding a global validation message to a form?
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>.
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