SmartClient Version: SNAPSHOT_v12.1d_2019-11-02/PowerEdition Deployment (built 2019-11-02)
I'm getting this exception on SpinnerItems:
Error: java.lang.NumberFormatException: 0.004 does not have either positive or negative affixes.
The exception is being thrown by: package com.google.gwt.i18n.client.NumberFormat.
The exception doesn't cause any problems per se, but I don't understand why it seems to be constantly thrown on every mouse up/down of the the spinner.
I suspect it is caused by the Validator defined on the spinner.
Question: Is there something I'm missing or can do to suppress the constant exceptions?
The Spinner is simply defined:
I'm getting this exception on SpinnerItems:
Error: java.lang.NumberFormatException: 0.004 does not have either positive or negative affixes.
The exception is being thrown by: package com.google.gwt.i18n.client.NumberFormat.
The exception doesn't cause any problems per se, but I don't understand why it seems to be constantly thrown on every mouse up/down of the the spinner.
I suspect it is caused by the Validator defined on the spinner.
Question: Is there something I'm missing or can do to suppress the constant exceptions?
The Spinner is simply defined:
Code:
String check = "foo_bar"; SpinnerItem spinner = new SpinnerItem(check + "_Slack", check.replaceAll("_", " ") ); spinner.setValue(0); Validator spinnerValidator = new Validator(); spinnerValidator.setType(ValidatorType.ISFLOAT); spinner.setValidators(spinnerValidator); spinner.setCriterionGetter(new FormItemCriterionGetter() { @Override public Criterion getCriterion(DynamicForm form, FormItem item) { Criterion result = null; if (item.getValue() != null) { if (!check.equals("Double_Clocking")) { result = new Criterion(item.getName(), OperatorId.EQUALS, 0 - ((Number) item.getValue()).floatValue()); } else { result = new Criterion(item.getName(), OperatorId.EQUALS, ((Number) item.getValue()).floatValue()); } } return result; } @Override public Criterion getCriterion(DynamicForm form, FormItem item, TextMatchStyle textMatchStyle) { return getCriterion(form, item); } }); spinner.setMin(0.0); spinner.setStep(.001); spinner.setWidth(200); spinner.setTitleOrientation(TitleOrientation.TOP); spinner.setHeight(25); spinner.setSaveOnEnter(true); spinner.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { if (event.getKeyName().equals("Enter")) { this.focusInNextTabElement(); } } });
Comment