12 Jan 2011 5:59 PM #1
[FNR] NumberField allowing decimals when explicitly disabled
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);
So I tried the using the setAllowDecimals feature
numberField.setAllowDecimals( false );
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?
7 Feb 2011 2:04 PM #2
I hate it when people "bump" threads, 5 minutes after posting. But thought this was a fair amount of time to..... *BUMP*
Is this a confirmed bug? I was expecting there to be some feedback by now, saying it will be fixed in 3.x etc.
30 Jun 2011 8:05 AM #3
I've had this same problem and ended up overriding the onKeyPress method to specifically check if the character is a '.'. The problem appears to be that the fe.isSpecialKey(getKeyCode(fe.getEvent()) logic doesn't work across all systems (I'm using a Mac)
1 Jul 2011 2:53 AM #4
This should be fixed in SVN now as of revision 2410
By jonjanisch in forum Ext GWT: Bugs (1.x)Replies: 0Last Post: 13 Jan 2009, 1:54 PM
By junkzilla in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 30 Oct 2008, 7:58 AM
By thomas.de in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 29 Sep 2008, 6:35 AM
By thejoker101 in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 20 Mar 2007, 8:55 AM