Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-03-03 Thread sven
I really like your refactorings on the validation stuff.

One additional request:

Thanks to Johan's addition I now get the following error message for my 
component 'bar' with a missing resource:

java.util.MissingResourceException: Unable to find resource:
 BazValidator for component: sub:form:foo

If we changed FormComponent#error(List,Map) so that localizer#getString() is 
called with 'this' instead of getParent(), we would get the following message:

java.util.MissingResourceException: Unable to find resource:
 CustomerValidator for component: sub:form:foo:bar

It should do no harm to extend the component stack by one component, but we'll 
get a more precise error message.

Thanks

Sven

 
i dont think it works like that.

the localizer searches up the component hierarchy, RequiredValidator is not 
in it so the validators have to explicitly ask localizer for both keys: 
formcompid.validator-key and validator-key. i dont think localizer knows 
enough to do it for us.

-Igor


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-03-01 Thread Igor Vaynberg
if nick can migrate before 1.2 i would like to remove it. its causing an extra resource lookup in my refactored code. its not a big deal but its bugging me because i know its there.-Igor
On 2/28/06, Martijn Dashorst [EMAIL PROTECTED] wrote:
Deprecate and remove in 1.3MartijnOn 3/1/06, Igor Vaynberg [EMAIL PROTECTED] wrote: so you do have a straight forward migration path away from it? maybe i will
 deprecate it for 1.2 and remove in 1.3 then. or ask again before we release 1.2 in case you had time to move.-Igor On 2/28/06, Nick Heudecker 
[EMAIL PROTECTED] wrote:  We're using it.We should move away from it, but I don't have the time to update everything in my app right now. On 2/28/06, Igor Vaynberg  
[EMAIL PROTECTED] wrote:   i would like to remove IValidatorResourceKeyFactory and so i want to know if anyone is using it and thus be affected. since we now have a good
 search order for resource keys instead of always trying formname.inputname.validator-class the factory is more or less obsolete. so if you are using it please respond.
 -Igor  --Living a wicket life...Martijn Dashorst - 
http://www.jroller.com/page/dashorstWicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1---
This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user



Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-03-01 Thread Nick Heudecker
You can remove it now and I'll just wait to update to the latest snapshot. IIRC, there's a wiki page on the new validation messages, correct?


Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-03-01 Thread sven
While you're at it, perhaps we could improve the error message on missing 
resources for validators? Currently all we get is:

java.util.MissingResourceException: Unable to find resource: RequiredValidator

Not very helpful :(. I'd preferred if Localizer (line 228) included the 
component's path, something like:

java.util.MissingResourceException: Unable to find resource: 
ComboBox$FoundValidator for component: sub.form.foo.bar

For this to work we have to strip down AbstractValidator#error(FormComponent, 
String, IModel):
{
 // Return formatted error message
 Localizer localizer = formComponent.getLocalizer();

 // Get the property value associated with the key.
 String key = Classes.name(getClass());
 String message = localizer.getString(key, formComponent, resourceModel);

 formComponent.error(message);
}

Please compare with the current implementation, which calls twice into the 
localizer with the formComponent's parent - first with the resourceKey and then 
with just the validator class.
IMHO this is duplicate work. Localizer (line 386) does something similar 
already.

Sven

 
if nick can migrate before 1.2 i would like to remove it. its causing an 
extra resource lookup in my refactored code. its not a big deal but its 
bugging me because i know its there.

-Igor

On 3/1/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 so you do have a straight forward migration path away from it? maybe i will
 deprecate it for 1.2 and remove in 1.3 then. or ask again before we release
 1.2 in case you had time to move.

  -Igor



 On 2/28/06, Nick Heudecker [EMAIL PROTECTED] wrote:
  We're using it.  We should move away from it, but I don't have the time to
 update everything in my app right now.
 
 
 
  On 2/28/06, Igor Vaynberg  [EMAIL PROTECTED] wrote:
   i would like to remove IValidatorResourceKeyFactory and so i want to
 know if anyone is using it and thus be affected. since we now have a good
 search order for resource keys instead of always trying
 formname.inputname.validator-class the factory is more or
 less obsolete.
  
   so if you are using it please respond.
  
   -Igor
  
  
 
 




--
Living a wicket life...

Martijn Dashorst - http://www.jroller.com/page/dashorst

Wicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-03-01 Thread Igor Vaynberg
ok i will remove it then. the validation messages will stay the same as they are with the default factory.-IgorOn 3/1/06, Nick Heudecker 
[EMAIL PROTECTED] wrote:You can remove it now and I'll just wait to update to the latest snapshot. IIRC, there's a wiki page on the new validation messages, correct?





Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-03-01 Thread Johan Compagner
I made the exception a bit more helpfull (component path is appended)I think we need to document and look how it exactly should work. johanOn 3/1/06, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
While you're at it, perhaps we could improve the error message on missing resources for validators? Currently all we get is:java.util.MissingResourceException: Unable to find resource: RequiredValidator
Not very helpful :(. I'd preferred if Localizer (line 228) included the component's path, something like:java.util.MissingResourceException: Unable to find resource: ComboBox$FoundValidator for component: sub.form.foo.bar
For this to work we have to strip down AbstractValidator#error(FormComponent, String, IModel):{ // Return formatted error message Localizer localizer = formComponent.getLocalizer(); // Get the property value associated with the key.
 String key = Classes.name(getClass()); String message = localizer.getString(key, formComponent, resourceModel); formComponent.error(message);}Please compare with the current implementation, which calls twice into the localizer with the formComponent's parent - first with the resourceKey and then with just the validator class.
IMHO this is duplicate work. Localizer (line 386) does something similar already.Svenif nick can migrate before 1.2 i would like to remove it. its causing an extra resource lookup in my refactored code. its not a big deal but its bugging me because i know its there.
-IgorOn 3/1/06, Igor Vaynberg [EMAIL PROTECTED] wrote: so you do have a straight forward migration path away from it? maybe i will
 deprecate it for 1.2 and remove in 1.3 then. or ask again before we release 1.2 in case you had time to move.-Igor On 2/28/06, Nick Heudecker 
[EMAIL PROTECTED] wrote:  We're using it.We should move away from it, but I don't have the time to update everything in my app right now. On 2/28/06, Igor Vaynberg  
[EMAIL PROTECTED] wrote:   i would like to remove IValidatorResourceKeyFactory and so i want to know if anyone is using it and thus be affected. since we now have a good
 search order for resource keys instead of always trying formname.inputname.validator-class the factory is more or less obsolete. so if you are using it please respond.
 -Igor  --Living a wicket life...Martijn Dashorst - 
http://www.jroller.com/page/dashorstWicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1---
This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-03-01 Thread Igor Vaynberg
i dont think it works like that.the localizer searches up the component hierarchy, RequiredValidator is not in it so the validators have to explicitly ask localizer for both keys: formcompid.validator-key and validator-key. i dont think localizer knows enough to do it for us.
-IgorOn 3/1/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
While you're at it, perhaps we could improve the error message on missing resources for validators? Currently all we get is:
java.util.MissingResourceException: Unable to find resource: RequiredValidatorNot very helpful :(. I'd preferred if Localizer (line 228) included the component's path, something like:java.util.MissingResourceException
: Unable to find resource: ComboBox$FoundValidator for component: sub.form.foo.barFor this to work we have to strip down AbstractValidator#error(FormComponent, String, IModel):{ // Return formatted error message
 Localizer localizer = formComponent.getLocalizer(); // Get the property value associated with the key. String key = Classes.name(getClass()); String message = localizer.getString(key, formComponent, resourceModel);
 formComponent.error(message);}Please compare with the current implementation, which calls twice into the localizer with the formComponent's parent - first with the resourceKey and then with just the validator class.
IMHO this is duplicate work. Localizer (line 386) does something similar already.Svenif nick can migrate before 1.2 i would like to remove it. its causing an extra resource lookup in my refactored code. its not a big deal but its bugging me because i know its there.
-IgorOn 3/1/06, Igor Vaynberg [EMAIL PROTECTED] wrote: so you do have a straight forward migration path away from it? maybe i will
 deprecate it for 1.2 and remove in 1.3 then. or ask again before we release 1.2 in case you had time to move.-Igor On 2/28/06, Nick Heudecker 
[EMAIL PROTECTED] wrote:  We're using it.We should move away from it, but I don't have the time to update everything in my app right now. On 2/28/06, Igor Vaynberg  
[EMAIL PROTECTED] wrote:   i would like to remove IValidatorResourceKeyFactory and so i want to know if anyone is using it and thus be affected. since we now have a good
 search order for resource keys instead of always trying formname.inputname.validator-class the factory is more or less obsolete. so if you are using it please respond.
 -Igor  --Living a wicket life...Martijn Dashorst - 
http://www.jroller.com/page/dashorstWicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1---
This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] is IValidatorResourceKeyFactory being used

2006-02-28 Thread Igor Vaynberg
i would like to remove IValidatorResourceKeyFactory and so i want to know if anyone is using it and thus be affected. since we now have a good search order for resource keys instead of always trying formname.inputname.validator-class
 the factory is more or less obsolete.so if you are using it please respond.-Igor


Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-02-28 Thread Nick Heudecker
We're using it. We should move away from it, but I don't have the time to update everything in my app right now. On 2/28/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:i would like to remove IValidatorResourceKeyFactory and so i want to know if anyone is using it and thus be affected. since we now have a good search order for resource keys instead of always trying 
formname.inputname.validator-class
 the factory is more or less obsolete.so if you are using it please respond.-Igor




Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-02-28 Thread Igor Vaynberg
so you do have a straight forward migration path away from it? maybe i
will deprecate it for 1.2 and remove in 1.3 then. or ask again before
we release 1.2 in case you had time to move.

-Igor
On 2/28/06, Nick Heudecker [EMAIL PROTECTED] wrote:
We're using it. We should move away from it, but I don't have the time to update everything in my app right now. On 2/28/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:i
would like to remove IValidatorResourceKeyFactory and so i want to know
if anyone is using it and thus be affected. since we now have a good
search order for resource keys instead of always trying
formname.inputname.validator-class
 the factory is more or less obsolete.so if you are using it please respond.-Igor






Re: [Wicket-user] is IValidatorResourceKeyFactory being used

2006-02-28 Thread Martijn Dashorst
Deprecate and remove in 1.3

Martijn

On 3/1/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 so you do have a straight forward migration path away from it? maybe i will
 deprecate it for 1.2 and remove in 1.3 then. or ask again before we release
 1.2 in case you had time to move.

  -Igor



 On 2/28/06, Nick Heudecker [EMAIL PROTECTED] wrote:
  We're using it.  We should move away from it, but I don't have the time to
 update everything in my app right now.
 
 
 
  On 2/28/06, Igor Vaynberg  [EMAIL PROTECTED] wrote:
   i would like to remove IValidatorResourceKeyFactory and so i want to
 know if anyone is using it and thus be affected. since we now have a good
 search order for resource keys instead of always trying
 formname.inputname.validator-class the factory is more or
 less obsolete.
  
   so if you are using it please respond.
  
   -Igor
  
  
 
 




--
Living a wicket life...

Martijn Dashorst - http://www.jroller.com/page/dashorst

Wicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user