Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FloatItem with Validators stooped working after upgrading to version 6.0

    Hello Guys,

    I created a small library of my own FormItems and it used to work perfectly fine till last week that I upgraded to 6.0.
    SmartGWT 6.0, GWT 2.6, all browsers !!!

    below is a snippet of one of my items "DecimalItem".
    1. ValidateOnExit does not work
    2. Losing focus trims the digits and keeps the first one.
    Code:
    [SUB] 
       /**
         * [USER="45788"]param[/USER] min
         * [USER="45788"]param[/USER] max
         * @return
         */
        private FormItem createDeciamlItem(String min, String max) {
            FloatItem floItem = new FloatItem();
            FloatRangeValidator frv = null;
            Validator[] v = null;
            if (ToolBox.isStrNotEmpty(min)) {
                frv = new FloatRangeValidator();
                frv.setMin(Float.valueOf(min));
            }
            if (ToolBox.isStrNotEmpty(max)) {
                frv = (frv == null ? new FloatRangeValidator() : frv);
                frv.setMax(Float.valueOf(max));
            }
            if (frv != null) {
                frv.setErrorMessage("Should be a positive number!");
                v = new Validator[] {new IsFloatValidator(), frv};
            } else {
                v = new Validator[] {new IsFloatValidator()};
            }
            floItem.setValidators(v);
            return floItem;
        }[/SUB]
    Did someone experience the same behaviour? I cannot afford to rewrite the code at this point
    if it's a bug I have to switch back to 5.0. till it's resolved.

    I appreciate any help in advance......

    #2
    we found a workaround,

    Use TextItem instead then it works !!!

    Code:
    TextItem floatItem = new TextItem();

    Comment

    Working...
    X