troyg
12 Jan 2011, 5:59 PM
GWT Version: 2.1.0
GXT Version: 2.2.1
With a NumberField, I've limited the input to only allow Integers... (as described in the javadoc)
NumberField numberField = new NumberField();
numberField.setPropertyEditorType(Integer.class);
But the problem is the user can still enter decimals.
So I tried the using the setAllowDecimals feature
numberField.setAllowDecimals( false );
But the user can still enter decimals.
After debugging, I found onKeyPress method of SpinnerField was never reaching the allowed keys section of code, and was jumping out early due the decimal character being classed as a "special" key (Key number of 46)
Let me know if you want a more complete example, as per the guidelines.. I just figured this is such a simple bug to explain.
FYI: I found thread where someone had reported a similar problem for GXT 1.x -it may be caused by the same bug?
http://www.sencha.com/forum/showthread.php?57221-1.2.1-NumberField-(Integer)-allows-decimals&highlight=NumberField+decimal+Integer
GXT Version: 2.2.1
With a NumberField, I've limited the input to only allow Integers... (as described in the javadoc)
NumberField numberField = new NumberField();
numberField.setPropertyEditorType(Integer.class);
But the problem is the user can still enter decimals.
So I tried the using the setAllowDecimals feature
numberField.setAllowDecimals( false );
But the user can still enter decimals.
After debugging, I found onKeyPress method of SpinnerField was never reaching the allowed keys section of code, and was jumping out early due the decimal character being classed as a "special" key (Key number of 46)
Let me know if you want a more complete example, as per the guidelines.. I just figured this is such a simple bug to explain.
FYI: I found thread where someone had reported a similar problem for GXT 1.x -it may be caused by the same bug?
http://www.sencha.com/forum/showthread.php?57221-1.2.1-NumberField-(Integer)-allows-decimals&highlight=NumberField+decimal+Integer