Problems with Validation

32 views
Skip to first unread message

tom2....@gmail.com

unread,
Apr 17, 2015, 12:45:39 AM4/17/15
to codenameone...@googlegroups.com
I use the new validation package in my app and implemented it like this:

// add validation
Validator.setValidateOnEveryKey(true);
val = new Validator();
val.addConstraint(tfFontSize, new NumericRangeConstraint(6, 100, fnLocalize("errNumericNotInRange")));
val.addSubmitButtons(btnSave);

I also defined the ...Invalid UIID for the TextField.

When I enter an invalid value, the TextField is highlighted and the btnSave is disabled, which is OK.
When I then correct the value, the TextField is not highlighted anymore, but the btnSave does not get enabled again!

Also, the highlighting only occurs when I leave the field, although the validation is done on every key press (I saw that in the Log output I added to the isValid method of my Constraint). Shouldn't the highlighting be done on every key press?

Tom

Shai Almog

unread,
Apr 17, 2015, 1:48:49 AM4/17/15
to codenameone...@googlegroups.com, tom2....@gmail.com
The highlighting changes but since we are in the midst of native editing its impractical to update the native editor.
Can you file an issue on the button enabling?
We'll try to fix it after the codefreeze.

tom2....@gmail.com

unread,
Apr 20, 2015, 6:16:49 AM4/20/15
to codenameone...@googlegroups.com, tom2....@gmail.com

The highlighting changes but since we are in the midst of native editing its impractical to update the native editor.


OK, I see. But then, the highlighting should be done when I leave the field, right?
This works fine on Android, but on my iPad mini 2, the highlighting is only done, when I leave the field by tapping the 'next' button on the virtual keyboard. Shouldn't it also highlight the field when I leave it by tapping into an other field? (it does the hightlighting, when I tap into an other field and then back into the invalid field...)


 
Can you file an issue on the button enabling?

OK, see issue #1457


Shai Almog

unread,
Apr 20, 2015, 11:55:16 AM4/20/15
to codenameone...@googlegroups.com, tom2....@gmail.com
I think I saw that issue, it might be a missing repaint. I think its reproducible with our demo code in the masking field. Can you file a separate issue on that?

tom2....@gmail.com

unread,
Apr 21, 2015, 10:09:20 AM4/21/15
to codenameone...@googlegroups.com, tom2....@gmail.com

I think I saw that issue, it might be a missing repaint. I think its reproducible with our demo code in the masking field. Can you file a separate issue on that?

OK, its issue #1459
 
Reply all
Reply to author
Forward
0 new messages