NumberField (Vaadin 7)

Some of you may have noticed already, but a month or so ago I did a quick conversion to get the old
NumberField
addon to work on Vaadin 7.
NumberField (Vaadin 7)
would benefit from quite a bit more refactoring still, and I’m sure it has many issues left, but it’s a starting point. I released a new version earlier today that fixed some localization issues and added Maven/Ivy compatibility, and I’ll try to find time to keep on improving it. Bug reports and suggestions are welcome to this thread.

Hi, I’m trying to use NumberField without any particular configuration but I’m not able to input any number.
I mean all numbers are cleaned after I’ve typed them. What I’m doing wrong ?
Using Vaadin 7.4.2

I saw such behavior when I wrote my own converter. I don’t understand how this addon checks values too. If I convert my oracle’s BigDecimal values to String (and result is, for example - “1”) - it shows me invalid number error. But what else can I do? Other converter types are not accepted…

I’m not using any converter. It is seems that NumberField is using his own converter with an US locale hardcoded.
I’m using field in a FieldGroup. I had implemented a field using client side validation with javascript but I’m not able to understand how to debug NumberField.

Hi!

Sorry for the delay, it’s been a pretty insane week and I completely forgot that I had things to do here. I updated the
test UI
to include some additional examples, FieldGroup included. I don’t remember running into the altogether disappearing numbers myself, but I hope that the example case will give you some clue what might be wrong there.

I’m afraid the original Vaadin 6 addon was pretty tightly tied to Doubles, so this converted version is as well. I’ll see if I can hack it to eat BigDecimals, but it might require a bigger rewrite. I’m also pretty busy right now, so this might take quite a while. The sources are available
here
, though, if you’d like to do your own experimenting.

Hi Anna,
thank you for the example code. I’ve tried again configuring NumberField before binding with FieldGroup
I’ve got the same behavior: I can type digits but they disappear.
I’m using a Float attribute with NumberField and a converter for disable grouping.
If I need really NumberField I’ll try with sources to understand the issue.

Hi, good morning,

I have this problem:

java.lang.NoClassDefFoundError: org/vaadin/ui/NumberField
at com.mycompany.testes.MainView.(MainView.java:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

My pom.xml have this:

    <dependency>
        <groupId>org.vaadin.addons</groupId>
        <artifactId>tuning-datefield</artifactId>
        <version>0.15.0</version>
    </dependency>        

Thank you.

Hi!

The dependency for NumberField should be

<dependency>
    <groupId>org.vaadin.ui</groupId>
    <artifactId>NumberField</artifactId>
    <version>0.1.3</version>
</dependency>

hi,
I’m sorry, I messed up when I copy and paste the dependency.
The error continues:

java.lang.NoClassDefFoundError: org/vaadin/ui/NumberField
at com.mycompany.testes.MainView.(MainView.java:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

My pom.xml file is attached
19813.xml (11.4 KB)

Sorry to take you for a novice programmer problem. I solved the problem buiding the project.

Glad to hear you got it solved :slight_smile: I was absolutely swamped with work towards the end of last week, sorry for not getting back to you sooner.

Hello,
NumberField in version 6 was a great and very helpful add on. Especielly in European applications constantly a value field for Euro’s is still needed. I think, it would be a great idea, the add on (like CustomField) to take in the standatd of Vaadin 7.x! Now each of us are experiments again. So let me start with my experiments.
Walter

Hi!

Similarly to Dmitriy Yankin, I’m trying to add a [font=courier new]
Converter[font=arial]

[/font]
[/font]to a
NumberField
: the
Double
value in the field should get converted to a
Length
, consisting of a
Double
value and a unit of measure the user selected. However, it looks like no matter which values I put in the field, the values are being marked as invalid. I’ll experiment some more and see if I can find out what’s going on. (Is there some useful way to find out which condition caused the validation to fail?)

As a side note, maybe
NumberField
should override
setConverter()
to expect a
Converter<Double, ?>
instead of a
Converter<String, ?>
?

The numberfield accepts SHIFT+alphabet values. It successfully ignores other smalll case characters but fails to do so when we click SHIFT+Any character.

I dont know where it handles the onKeyDown listener, can somebody help me with this?

So, this is my problem too.

Hola he tratado de utilizar estos add-on como number7 o el masktextfield y no funcionan muy bien o la explicación de como utilizarlos no es muy clara.

Sanket & Tamás:
Sorry, it’s been a busy autumn, haven’t got to investigating that yet. I’m not sure whether the original Vaasin 6 version of the add-on had the same problem or if something broke in the conversion, but I’ll try to find some time to check it out.

Jesus:
I’m afraid I don’t speak Spanish(?), and am not entirely sure I understood the question correctly from running it through Google Translate, but in case you were asking for usage examples, you can find a simple test UI for this addon
here
.

Hi good morning, and thank you very much for your attention, and great maid your interest.
I don´t speak very well english.
Your answer is correct.

Have a good day.

HI,

I migrated a Vaadin application from Vaadin 7.5.10 to Vaadin 7.6.0 last week end and since I have an error
“SEVERE:Communicationerror:InvalidJSONresponsefromserver” when forms are received by the navigator ( Firefox, Chrome, IE ).
I search the reason and I observe that only the UI that content one or more NumberField addon failed to be displayed by the navigator.
I use the last numberfield (v7) 0.1.3
I haved a new compilation of my widgetset
I join the a json stream that failed to be displayed. Json stream syntax is ok.

Perhaps the reference to the numberfield.css ?
Perhaps you have to produce a new version for Vaadin 7.6.0 ?

Thanks for a response or a delay. The problem is blocking
Best regards

Attachment seems creates a trouble so I send without