Number formats in numeric converters

2012-04-20 Thread Martin Grigorov
Hi, Working on https://issues.apache.org/jira/browse/WICKET-4501 I see that it is quite hard to set custom number format for the converter used by NumberTextField (NTF). The problem in 4501 is that when T in NumberTextFieldT is Float, Double or BigDecimal the produced value by #convertToString()

'Strange' code inside TagAttributes

2012-04-20 Thread Andrea Del Bene
Hi, working on issue 4505 I've noticed that class TagAttributes has the following put method: @Override public final void putAll(Map? extends String, ? map) { for (Object o : map.keySet()) { String key = (String)o; } super.putAll(map);

Re: 'Strange' code inside TagAttributes

2012-04-20 Thread Martin Grigorov
Hi Andrea, Strange indeed! I think it should be : @Override public final void putAll(Map? extends String, ? map) { for (Map.Entry? extends String, ? entry : map.entrySet()) { String key = entry.getKey();

Re: 'Strange' code inside TagAttributes

2012-04-20 Thread James Carman
On Fri, Apr 20, 2012 at 9:39 AM, Martin Grigorov mgrigo...@apache.org wrote: ? extends String looks strange too Yes, especially since String is final. Curiouser and curiouser. :)

Re: 'Strange' code inside TagAttributes

2012-04-20 Thread Andrea Del Bene
IMHO this version of putAll can be removed...or not :)? Hi Andrea, Strange indeed! I think it should be : @Override public final void putAll(Map? extends String, ? map) { for (Map.Entry? extends String, ? entry : map.entrySet()) {

Re: 'Strange' code inside TagAttributes

2012-04-20 Thread Martin Grigorov
On Fri, Apr 20, 2012 at 4:44 PM, Andrea Del Bene adelb...@ciseonweb.it wrote: IMHO this version of putAll can be removed...or not :)? No. Why ? #put() does unescape for the value, so #putAll() should do the same. Hi Andrea, Strange indeed! I think it should be :        @Override        

Re: 'Strange' code inside TagAttributes

2012-04-20 Thread Andrea Del Bene
Oops! i didn't see your corrected version. On Fri, Apr 20, 2012 at 4:44 PM, Andrea Del Beneadelb...@ciseonweb.it wrote: IMHO this version of putAll can be removed...or not :)? No. Why ? #put() does unescape for the value, so #putAll() should do the same. Hi Andrea, Strange indeed! I think

Re: 'Strange' code inside TagAttributes

2012-04-20 Thread Martin Grigorov
I just committed my version. On Fri, Apr 20, 2012 at 4:54 PM, Andrea Del Bene adelb...@ciseonweb.it wrote: Oops! i didn't see your corrected version. On Fri, Apr 20, 2012 at 4:44 PM, Andrea Del Beneadelb...@ciseonweb.it  wrote: IMHO this version of putAll can be removed...or not :)? No.

Re: Number formats in numeric converters

2012-04-20 Thread Sven Meier
Hi Martin, IMHO we shouldn't touch grouping in display of numbers (e.g. in labels), so -1 for changing it globally. BTW if somebody registered his own converter for numbers, he would again have to take care of grouping by himself. Instead we could 3) Skip converters and do formatting of

Re: Number formats in numeric converters

2012-04-20 Thread Martin Grigorov
Hi Sven, On Fri, Apr 20, 2012 at 6:32 PM, Sven Meier s...@meiers.net wrote: Hi Martin, IMHO we shouldn't touch grouping in display of numbers (e.g. in labels), so -1 for changing it globally. BTW if somebody registered his own converter for numbers, he would again have to take care of

Re: Number formats in numeric converters

2012-04-20 Thread Sven Meier
((AbstractDecimalConverter?)converter).getNumberFormat(getLocale()).setGroupingUsed(false); will set the flag on a NF instance which will be thrown away immediately. Right, I should have tried that out first :/. do formatting of values in NTF explicitly What do you mean with this ?

Re: Number formats in numeric converters

2012-04-20 Thread Sven Meier
BTW I didn't say I prefer the solution without converters ;). I just wanted to offer alternatives to the global grouping change. Sven On 04/20/2012 06:32 PM, Sven Meier wrote: ((AbstractDecimalConverter?)converter).getNumberFormat(getLocale()).setGroupingUsed(false); will set the flag on