PDA

View Full Version : [Firefox 2 / GXT 2.1.3] Numberfield validation



sdumas
16 Jun 2010, 5:18 AM
On Firefox 2 and GXT 2.1.3, I am facing a validation problem :



long max=10000000L;
numberField.setMax(max);


With this exemple, validation fails when I am setting a value greater than 999,99 in this field.

It does'nt seem to be a GWT problem as when I display the max value, I get the right value.

sven
16 Jun 2010, 5:24 AM
There is no method setMax. It works fine for me with setMaxValue. Please read the bugforum guidelines and post a fully working testcase that implements EntryPoint

Also have you told the numbefield to use a long type?

sdumas
16 Jun 2010, 5:54 AM
Hum I meant the method setMaxValue.

The numberfield uses a double type but it doesn't matter as setMaxValue requires a Number.
When I display the value from the method getMaxValue, I am getting the correct value.

Moreover, this problem occurs only on Firefox 2.

sven
16 Jun 2010, 5:56 AM
Can you please post a fully working testcase that implements EntryPoint and also give me the exact number you enter that fails. I also need to know your locale settings.

sdumas
16 Jun 2010, 8:54 AM
After some investigation, this problem on Firefox 2 comes from a GWT 2 bug relative to NumberFormat when it parses a number greater than 1000 with the french number separator (space). I don't know if the problem occurs with other locales.

A refactoring of NumberFormat is scheduled for GWT 2.1, let's hope that the problem will be fixed. For the moment, I patched the GXT code to remove the separator during validation.