enable DEBUG logging of Localizer class and you'll see what resource
keys are attempted
this way you'll see that you can use "myFormComponentId.Required=...."
and it will be used just for the component with id
"myFormComponentId", all other will still use 'Required'.

On Fri, Aug 26, 2011 at 3:18 PM, Florian B. <[email protected]> wrote:
> I finally solved my problem perhaps it's not the best way but it works for
> me.
>
> After digging in the sources of the SignInPanel I figured out the following.
> setRequired() is always called in the constructor of a PasswortTextField.
> setRequired() is a method of the FormComponent class which has also a method
> reportRequiredError() that writes the error message.  In the implementation
> of the method you can see that the resource key for the required error
> message is "Required". So I simply override this key in the properties file
> of my login page and it worked perfectly.
>
> private void reportRequiredError()
> {
>    error(new ValidationError().addMessageKey("Required"));
> }
>
> I know it is not the best solution as this will override the required error
> message of any other FormComponent object on the login page on which
> setRequired(true) was called. But as the SignInForm is the only Form on my
> login page this is ok for me.
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/How-to-override-SignInPanel-s-error-messages-tp3770610p3770703.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]
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to