Hybrid View
-
27 Jan 2013 6:15 AM #1
SpinnerField with empty text causes ParseException
SpinnerField with empty text causes ParseException
Required Information
Version(s) of Ext GWT
Ext GWT 3.0.1
Browser versions and OS
(and desktop environment, if applicable)- every browser
Virtual Machine
No
Description
Clicking a SpinnerButton of a SpinnerField with emtpy Text causes a ParseException
Run mode
development mode
Steps to reproduce the problem- Start running in development mode in Eclipse
- Open app in browser
- Click the Spinnerbutton
Expected result
No ParseException
Actual result
ParseException
Test case
Helpful InformationCode:final SpinnerField<Integer> spResult = new SpinnerField<Integer>(new IntegerPropertyEditor()); spResult.setEmptyText("emptyText"); spResult.setAllowBlank(false); spResult.setMinValue(0); spResult.setMaxValue(6);
Debugging already done- «none»
Possible fix
No empty Text
-
28 Jan 2013 12:24 PM #2
I'm having an hard time reproducing this issue. Here is the entrypoint I've been using:
I then launched the page (tested in ff and chrome), click the spinner button (tested up btn, down btn, and the input itself), and then click out. An error is displayed in two cases - the input itself (since allowBlank is false, and there is no value), and down (this might be a bug, but it isn't a ParseException, it is still the "This field is required message"). No error is displayed at all when clicking up.Code:public class Test implements EntryPoint { public void onModuleLoad() { SpinnerField<Integer> field = new SpinnerField<Integer>(new IntegerPropertyEditor()); field.setEmptyText("emptyText"); field.setAllowBlank(false); field.setMinValue(0); field.setMaxValue(6); RootPanel.get().add(field); } }
Can you confirm that it isn't a parse exception, but just the allow blank message? And that you expect that clicking down will automatically draw zero?
-
30 Jan 2013 4:00 AM #3
I can confirm, that it isn't a parse exception. I can't reproduce the bug with the code of you. There must be an other problem in my application.
To your second question. I think that this is a question of designing the SpinnerField. I think it will be a good behaviour if the value is null and then if i click the down btn the value will be 0.
In my application i was switching from the SpinnerField to a ComboBox. And thats because of the behaviour of the SpinnerField. In a ComboBox i need two clicks to select the value 6 for example. In a SpinnerField i need six clicks.
Lock at the SpinnerField in GXT 2.2.6. You can click and hold the mouse button an the value is changing.
http://www.sencha.com/examples-2/#forms
In GXT 3.0.1 you have to click all the time. It's maybe a BUG?!
http://www.sencha.com/examples/#Exam...e:formsexample
-
31 Jan 2013 10:31 AM #4
Thanks - as in your other threads, please open a new bug for a new issue - holding the mouse down is not really related the the thread at hand. This issue is filed as EXTGWT-2799.
We will consider the issue of selecting the default value (zero) when no text is entered and a minimum is set, but I'm not sure we'll commit to a particular resolution on that now.
As far as more clicks to do the same thing in ComboBox vs SpinnerField, isn't that sort of the point? If the value was 10, you'd have ten clicks to select the value (assuming integers) in a spinner field, but again two clicks in a ComboBox. Even in the case of http://www.sencha.com/examples-2/#forms, I'd challenge you to select 00.6 or 06.0 in two clicks consistently even with holding the mouse down - these are different types of fields and are meant to be interacted with differently. ComboBox is good at selecting from a list, whereas SpinnerField is good at making small modifications to existing values.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote