I'm trying to supply my own resourceKey for the error message text along with a Map of model objects for specializing the error message... For example: "Field ${attr.name} is required".   I can't use the supplied key because the wicket component name is the same for every form field (I wrote a generic bean editing component that uses specialized metadata classes for specifying which fields are editable and what types they are, etc.). 
 
This is something I've wanted to do for a long time and Wicket allows it to be done very elegantly.
 
 


>>> [EMAIL PROTECTED] 2005-01-14 3:06:29 PM >>>


Jonathan Carlson wrote:

> (I am using CVS as of last Monday or so)
> 
> In order to use the cool new errorMessage(...) methods in
> AbstractValidator, I would like to suclass RequiredValidator and
> PatternValidator (and probably others as well) to provide my own error
> resourceKey and resourceModel map.
> 
> However, the AbstractValidator subclasses are final.  Could we please
> open these up or else provide a way to provide our own resoruceKey and
> resourceModel without subclassing?  (Like maybe with getters and
> setters).  I was willing to copy the logic from RequiredValidator to
> my own validator class, but the PatternValidator is more complex and I
> really shouldn't have to copy all that stuff, right?

btw, for anyone who has been wondering about the usefulness of defensive
programming with final, private, etc... this is a perfect example. 
there's possibly some use case here we didn't anticipate.  if these
classes had been extensible, there might be dozens of people out there
subclassing them in order to implement functionality that we might
ultimately decide should be part of the API.  and with all those
unanticipated subclasses to support, we'd have very little flexibility
to change our AbstractValidator subclasses in the future without
breaking the world.

anyway, what problem are you trying to solve, jonathan?

> 
> I'm curious about your response.  Thanks!
> 
> - Jonathan
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> www.katun.com
> **********************************************************************


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to