> I'm not convinced yetI still don't like > formComponent.getLabel() very much for the reasons mentioned.
Looks like we are on completely opposite sides of the spectrum here. How do you propose we move forward? > > 2) can already be done by providing your own > > IValidatorResourceKeyFactory - > > How did you do it? IValidatorResourceKeyFactory is > application static and thus can not vary from validator to > validator. I think what is required is a 2-step approach. > First try the default key created by > apps.getValidatorResourceKeyFactory.getKey and if not found try key = > Classes.name(validator.getClass().getName()) All I meant is that you can use IValidatorResourceKeyFactory to return a key based solely on the validators class name. I've been brooding about this problem for a while and the cleanest/simples solution I see is to add the label model to the formcomponent. That's how I have it working now - patched version of wicket. The other approach I worked out is to have a FormComponentLabel that takes a reference to the form component, and then inside the validator traverse the compoent tree and find the linked FormComponentLabel and use its model. That worked great until I hit a scenario where a formcomponent did not have a visible label, then I had to add an invisible formcomponentlabel to the form which is less elegant so I patched wicket to have the label inside the formcomponent. -Igor ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user