PDA

View Full Version : [FIXED] ArrayIndexOutOfBoundsException on NumberField<T>.setAllowDecimals



icfantv
30 Jan 2012, 3:30 PM
Here's the code:




import com.google.gwt.core.client.EntryPoint;
import com.sencha.gxt.widget.core.client.form.NumberField;
import com.sencha.gxt.widget.core.client.form.NumberPropertyEditor;


public class MainEntry implements EntryPoint {


@Override
public void onModuleLoad() {

NumberField<Integer> integerField =
new NumberField<Integer>(new NumberPropertyEditor.IntegerPropertyEditor());
integerField.setAllowDecimals(false); // throws an exception
}
}


In theory, I think a developer might expect the allowDecimals property to be set implicitly to false because he/she is specifying an integer type with an integer property editor and integers are whole numbers.

If I don't call setAllowDecimals the field allows the . character which as previously mentioned violates the premise of having an integer field.

icfantv
17 Feb 2012, 3:25 PM
Fixed in beta 3 per release notes:

[EXTGWT-1350] - Exception is thrown when setting allow decimals to false on a NumberField