Well, basically because there is no such a feature in the Vaadin core yet and I don’t remember seeing any other add-on which provides HTML5 fields. I’m sure that these will pop up at some point, it shouldn’t be too hard exercise. I think I have actually started one project but didn’t finish with it. We are commonly quite conservative with new features because we want to have wide browser support, so we haven’t rushed to add them to core.
Ok. So you mean autocorrect and autocapitalize properties (booleans). I should have added a generic Html5Field to TouchKit as well and use it as a super class for NumberField and EmailField. If you happen to start using TouchKit I think you could use the plain EmailField here. It sets both autocapitalize and autocorrect off, and I think it currently has no email validator so you can probably add values without @ character as well. That shall be the official hack until next version…
Thanks for the reply. What could we do to see that in the core? I understand being conservative with this but how about a property that would allow me to configure that feature? It’s not an ipad feature only actually, it uses HTML5 feature if you want by enabling the property …
I still don’t understand what would cost me to use touchkit since the same app is used both for regular browser and ipad now. Should I have a separate application with a separate URL for the iPad version, using touchkit?
Something like Component.addAttribute(String attributeName, String value)
This would make it possible to use HTML 5 placeholder texts, lang attributes, disabling spellcheck, …
As well as not yet part of any spec feature which will come in the near future.
In Vaadin 7, one could quite easily write an Extension for setting arbitrary HTML attributes for components. However, it would need some way of selecting the exact element you want to add the attribute to as it may not be the “root” element of the corresponding widget in all cases.
Looks excellent, gotta try this someday. Could you share that in
Directory at some point? Lots of Vaadin users will look add-ons primarly from there so you’ll get lot more audience via it.
Bora, thanks you like it! So far, I don’t have plans to upgrade it; esp. because the JavaScript extensions became so popular. I didn’t checkout Viltrin myself in depth - but a short glimpse into it looks promising (and like a solution for HTML5, too). Anyways: let us know whether Viltrin is a valid path for you and where improvement is still needed…
Hi Matti, Number input is the most urgent field. We had started with TouchKit addon a year ago but had a lot of problems with css and valo theme. We stopped using it when Vaadin announced EOL for Touchkit. We miss the native fields of touchkit…
I’ll check out Viritin. But shouldn’t this be part of Vaadin Core?
Does Viritin have number input field with decimal values, double values? There is “IntegerField” on Viritin’s “Improved input fields”. Can this field handle fields with double values?
I’m a bit lost on this. I need the numeric keyboard on mobile devices and set a mask or pattern (for non integer values like 1.25) to the text field. I tried the addons on Directory non of them work properly on mobile devices.
To sum up, I need a field which can also take decimal values, which rejects text values and opens numeric keyboard on mobile devices.
the point is that as far as the “old” add-on goes, it does little more than setting the type-attribute of a default input (away from text to e.g. number) + set a couple of additional attributes. As I understood Matti, this is what Viltrin can also do (or custom JS) - though I didn’t try any of it yet. I don’t know when I’d have substantial time to look into it - tough Viltrin would be my start to do so… Long story short: be encouraged to check out Viltrin.
Thanks Matti. DoubleField was just the thing I needed. Safari on IOS works great. You can’t type illegal double values with it. But on anroid and desktop browsers (Chrome and Firefox) I am able to type invalid double values like 54,44 or 343,54,54,54.
Forgive my ignorance, Is this behaviour from the browsers and unavoidable or can anything be done from Vaadin side?
There sure might be a change to fill in some illegal characters in some cases, but the actual value will then become null.
Can you let me know what OS/device you tried? I tested the thing in Mac and Win7 with all major browsers and I couldn’t fill in multiple decimal separators. The JS hook should prevent those.
Just tested with a colleagues Android, with that it seems it is possible to add multiple dots. The JS hook probably don’t work there so I don’t know what else we could do there. With server side validator you can naturally give a helpful error message.