there is no way to find out what resource key the validator will check
other then read the javadoc where they should be specified. by default
we follow a convention that validator uses the resource key of its
class name

so NumberValidator will use a resource key "NumberValidator"
StringValidator.minimum will use "StringValidator.minimum", etc

-igor


On Feb 19, 2008 2:54 PM, MYoung <[EMAIL PROTECTED]> wrote:
>
> Hi, I'm learning wicket and I have a hard time determining the resourceKey of
> a component.
>
> In my code:
>
>         Form form = new Form("myForm") ....
>
>         TextField weight = new TextField("weight", Integer.class);
>         weight.setRequired(true);
>         weight.add(NumberValidator.minimum(0));
>         form.add(weight);
>
>
> Since I call
>
>         weight.setRequired(true);
>         weight.add(NumberValidator.minimum(0));
>
> I know I need at least the resourceKeys for these two cases.
>
> By looking into the NumberValidator.java source, I can find the resourceKey
> for 'minimum' is "myForm.weight.NumberValidator.minimum".  I know
> setRequired corresponds to 'myForm.weight.Required' from other example.
>
> But what about other resourceKey?  How do I find what they are?  For
> example, entering 'xyz' will result in 'xyz' is not a valid Integer.  How to
> find what this resourceKey is?
>
> In general, what is the way to find out all possible error resourceKeys?
> --
> View this message in context: 
> http://www.nabble.com/How-to-find-all-error-resourceKeys-of-a-form-field--tp15577859p15577859.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to