hi dominic,
I m receiving key press event in all the browser the thing that i have
noticed which doesn't work in GWT 2.1 is -
*if(event.getCharCode()==KeyCodes.KEY_ENTER){ *
the o/p of event.getCharCode() in GWT 2.1 is nothing not even 0 so i cnt
compare it with KeyCodes.KEY_ENTER
i had tried one more new method that has been introduced in GWT 2.1 which
getUnicodeCode() which gives 0 whenever i presses ENTER but this is not the
right because i m getting 0 even when i m pressing any arrow key.
how to figure this out...?
--
Aditya
On Fri, Dec 3, 2010 at 5:46 PM, dominic jansen <[email protected]>wrote:
> hi aditya,
>
> i ve noticed that there are different behaviours for the
> KeyPressHandler for each browser (e.g. for me the safari browser did
> not recognize the keypressevent).
>
> maybe you can use the KeyDownHandler or KeyUpHandler instead of the
> KeyPressHandler. this worked for me....
>
> best, dom
>
>
>
> 2010/12/3 Aditya <[email protected]>:
> > Hi,
> >
> > I have updated my GWT version to 2.1 and faced some of the problems
> > regarding textbox' key press handlers...
> >
> > the code which works completely fine in previous version is
> >
> > txtPassword.addKeyPressHandler(new
> > KeyPressHandler() {
> > @Override
> > public void onKeyPress(KeyPressEvent event) {
> >
> >
> if(event.getCharCode()==KeyCodes.KEY_ENTER){
> > // some processing here to send
> > username password to server
> > }
> > // class closures.
> >
> > whenever user presses an ENTER key the code from 'if' condition gets
> > executed but this does nt work in GWT 2.1
> > is there any other way to perform this validation to know user has
> > striked ENTER or not...?
> >
> > Thanks,
> > Aditya
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> > To post to this group, send email to [email protected]
> .
> > To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> > 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 post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> 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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.