i think Localizer looks in other places too. for example in your Application subclass, so you can have global string resources and not have to dup them all over the place...


Eelco Hillenius wrote:

Stefan Lindner wrote:

Just one step forward to the solution:

If you use a CustomValidator and bind it to an TextField (and perhaps
other input fields) you MUST have a resource file with the name schemea
<name of your class associated with the form element>.properties.

Actually, it is like <name of any of the containing classes that holds markup>.properties as far as I know, but I really have to get into this resource stuff sometime. It should be far more flexible than just forcing you to use a binded properties file. In particular, you should read the javadocs of wicket.Localizer and wicket.markup.html.form.validation.AbstractValidator.

Maybe any of the other devs (Chris, John, Juergen) could tell you more about this?

The
ressource file should contain the ressource <name of your class
associated with the form element starting with lower case letter>.<name
of the TextField>.<name of the class ot the CustomValidator>. In my case
datenForm.text1.DatumsValidator.



Yeah. But it depends on the implementation how the resource key look. You can provide your own if you want, just as I do here:


protected void error(String input, FormComponent component, ConversionException e)
{
Map ctx = messageModel();
ctx.put("fieldDescription", inputElement.getDescription());
ctx.put("input", input);
String resourceKey = "typeError." + e.getTargetType().getName();
error(resourceKey, ctx);
}


So you could do 'error("my.own.resource.key")' as well.

Eelco


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user





------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to