wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Meier <s...@meiers.net>
Subject Re: Validation messages from properties file not working.
Date Wed, 23 Aug 2017 19:55:56 GMT
Hi,

FormComponent has a special error() method for ValidationErrors.

You're hitting another method on Component, that just accepts any 
serializable:

     ((WebMarkupContainer) form.get("wmcCaptchaError")).error(new 
ValidationError().addKey("CaptchaRequired"));

Try the following instead:

     ((WebMarkupContainer) 
form.get("wmcCaptchaError")).error(form.getString("CaptchaRequired"));

Regards
Sven


Am 23.08.2017 um 19:18 schrieb Entropy:
> Yeah, it's definitely related to the component that the
> ComponentFeedbackPanel relates to.  If I use a TextField, it finds the
> message perfectly.  I change it to a web markup container or hiddenfield,
> and it fails to find the message.  Same name, same code doing the validation
> and the adding of the validation key.
>
> I tried a TextField with visibility set to false and that didn't even show
> the error (which makes sense).
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Validation-messages-from-properties-file-not-working-tp4678575p4678588.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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


Mime
View raw message