Trigger validation upon keypressed

1 view
Skip to first unread message

P.G.Taboada

unread,
Jul 22, 2010, 8:03:08 AM7/22/10
to GWT Pectin
Hi,

is there any way to tell FormBinder to react to key key pressed
events?

I am playing with a simple login form. Wanted to showcase disabling/
enabling fields:


enable(password).when(valueOf(username).isNot(""));


I want password to be immediately enabled, as soon as some keys a
pressed.

Suggestions?

brgds

Papick

Andrew Pietsch

unread,
Jul 22, 2010, 9:06:29 AM7/22/10
to gwt-pecti...@googlegroups.com
Howdy,

I'm currently doing this by using a widget that fires value change events after each key press.  Pectin has three classes for this, EnhancedTextBox, EnhancedTextArea and EnhancedPasswordTextBox.  You're example should work if it's bound to one of these widgets. 

There's also a Conditions.textOf(userName).isEmpty() you might want to look at.  I know 0.8 snapshot has an isBlank() condition too but I'm not sure if that's in 0.7 or not.

Cheers
Andrew
Reply all
Reply to author
Forward
0 new messages