ValueChanged in TextBox

55 views
Skip to first unread message

muhannad nasser

unread,
Apr 17, 2010, 4:50:39 AM4/17/10
to Google-We...@googlegroups.com
hi all;

i am facing a problem with the text box.... i need to catch an event when the value of the text has changed... but if i use the ValueChangedHandler it will not fire until there is a lose focus on the text field.... and if i use the onKeyPress event... and i get the text from the textBox i still read the old value...... so i need an event that i can detect the change when the user clicks any button and also i can g et the new value from the text box..... can anyone help... please

--
~~~With Regards~~~
Muhannad Dar-Nasser
~~Computer Systems Engineering~~

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
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.

Thomas Broyer

unread,
Apr 17, 2010, 6:03:49 AM4/17/10
to Google Web Toolkit


On Apr 17, 10:50 am, muhannad nasser <muhannadna...@gmail.com> wrote:
> hi all;
>
> i am facing a problem with the text box.... i need to catch an event when
> the value of the text has changed... but if i use the ValueChangedHandler it
> will not fire until there is a lose focus on the text field.... and if i use
> the onKeyPress event... and i get the text from the textBox i still read the
> old value...... so i need an event that i can detect the change when the
> user clicks any button and also i can g et the new value from the text
> box..... can anyone help... please

KeyUp?

But you'll also have to handle Paste and Cut events.

HTML5 introduces a new "input" event [1] to address this exact use
case, but it's not supported on Internet Explorer, where it can be
emulated with onpropertychange [2]; but GWT won't allow you to do so,
at least not easily (or not easily enough).
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#event-input-input
[2] http://help.dottoro.com/ljhxklln.php

muhannad nasser

unread,
Apr 17, 2010, 6:34:24 AM4/17/10
to google-we...@googlegroups.com
thaaaaaaaanks... 

it works fine.. i mean the KeyUp Event... :)
--
~~~With Regards~~~
Muhannad Dar-Nasser
~~Computer Systems Engineering~~

Reply all
Reply to author
Forward
0 new messages