IFeedbackMessageFilter?
On Fri, Feb 12, 2016 at 3:24 PM, Lorne Malvo <[email protected]>
wrote:
>
> I have a form with a large number of textfields I want to validate for
> numerical input. However, if multiple fields fail validation, I want to
> display only a single error message.
>
> I'm using an AjaxSubmitLink to submit my form.
>
> To avoid displaying multiple error messages when multiple textfields fail
> validation, I figure I could just delete all FeedbackMessages generated
> during form validation, and then register my own FeedbackMessage.
> However, it seems a thing of impossibility to delete (or mark as rendered)
> existing FeedbackMessages.
>
> I'm trying to do this in an AjaxSubmitLink's onError() method like this:
>
> FeedbackCollector collector = new FeedbackCollector(form);
> for (FeedbackMessage fm : collector.collect()) {
> fm.markRendered();
> }
>
> But that doesn't do the trick. The feeback messages are found, but marking
> them as rendered doesn't prevent them from being displayed.
> I also tried collector.collect().clear() but that also doesn't work.
>
> I also tried to do the same thing by overriding the form's onValidate()
> method and deleting the messages right after validation, but that also
> doesn't work.
>
> How to get rid off these damn things? :)
>
> Thanks!
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-get-rid-off-Feedback-Messages-tp4673577.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Regards - Ernesto Reinaldo Barreiro