protected ValueBox(Element element, Renderer<T> renderer, Parser<T> parser) {
super(element, renderer, parser);
// BiDi input is not expected - disable direction estimation.
setDirectionEstimator(false);
if (LocaleInfo.getCurrentLocale().isRTL()) {
setDirection(Direction.LTR);
}
assert InputElement.as(element).getType().equalsIgnoreCase("text");
}
The assertion is for "text" and I don't see any validators for say Integer. So at first glance, didn't look to see if there is more going on behind the scenes, yeah, it's incomplete.
Regards,
Alfredo
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/zGmwodizajMJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/kaR928iw2dQJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
I respectfully see this slightly different. An IntegerBox should prevent the user from typing non-integers from the start with ways to customize the error message, etc... It's nice that it's generified, but one might expect it to have a validator built-in. Not that it would be terrible to add one as you point out, but it should be built-in since in this case the name is IntegerBox. If it would have been a NumberField or something along those lines, then the same could have been accomplished like GXT does by setting a property editor that could be Integer, Double, etc. So I don't see it doing 100% what it should do.I see this as a potential feature request. An easy one to add, nevertheless, not one that the user should have to implement.
I respectfully see this slightly different. An IntegerBox should prevent the user from typing non-integers from the start with ways to customize the error message, etc... It's nice that it's generified, but one might expect it to have a validator built-in. Not that it would be terrible to add one as you point out, but it should be built-in since in this case the name is IntegerBox. If it would have been a NumberField or something along those lines, then the same could have been accomplished like GXT does by setting a property editor that could be Integer, Double, etc. So I don't see it doing 100% what it should do.
-- J.--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/RLtrB5vaIJQJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
I always try to keep in mind that GWT is a tool kit. However, when a class is named IntegerBox, to be used in a UI, yeah I expect it to be type safe and also do what its name implies in the UI as well as programmatically. In this case only allow Integers to be typed in.
In any case, I'll hang on to this email and instead of talking more, perhaps when I have some free time I'll just get to it and see if I can add the implementation for it, test it across browsers and submit it for a patch review. No promises since I am really busy these days, but we'll see.
Appreciate the responses.
--You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
-- J.--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/PG8WHFAnWBEJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Alfredo
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsub...@googlegroups.com.