On 08/23/2011 03:00 PM, Roustalski wrote:
> com.google.gwt.event.dom.client.KeyPressEvent.class only has a
> getCharCode method and does not have a getKeyCode method.

That may be, but you're asking for the underlying NativeEvent, which
does have a getKeyCode()

> 
> On Aug 23, 4:48 pm, Jeff Chimene <jchim...@gmail.com> wrote:
>> On 08/23/2011 02:38 PM, Roustalski wrote:
>>
>>> Thanks for your response, but I'm confused.
>>
>>> I'm using com.google.gwt.user.client.ui.TextBox.
>>
>>> Here is the event handler that I'm using:
>>
>>>         @UiHandler( "tbName" )
>>>    void onTbNameKeyPress( KeyPressEvent event )
>>>    {
>>>            Log.info( "Event char code: " +
>>> String.valueOf( event.getCharCode() ) );
>>>            //event.getNativeEvent().
>>>            if ( event.getNativeEvent().getCharCode() == KeyCodes.KEY_ENTER )
>>
>> I'd suggest using getKeyCode() instead of getCharCode()
>>
>>
>>
>>
>>
>>
>>
>>>                    // ...
>>>    }
>>
>>> I've also tried event.getCharCode() and it also fails. This works on
>>> Safari, FF <= 5, and Chrome on MAC OSX.
>>
>>> Is my logic wrong? Why do I need to use specific code for a particular
>>> version of a browser?
>>
>>> On Aug 23, 3:52 pm, Jeff Chimene <jchim...@gmail.com> wrote:
>>>> On 08/23/2011 12:42 PM, Roustalski wrote:
>>
>>>>> Has anyone else noticed that text boxes do not show the focus ring
>>>>> when the element has focus, and that a KeyPressEvent looking for the
>>>>> charCode KeyCodes.KEY_ENTER doesn't actually work?
>>
>>>> Take a look at the onBrowserEvent in
>>>> com.google.gwt.cell.client.EditTextCell.class
>>
>>>> I see:
>>>> boolean enterPressed = "keyup".equals(type)
>>>>           && keyCode == KeyCodes.KEY_ENTER;
>>
>>>> and the edit mode of EditTextCell works for me. So, maybe rewrite the
>>>> logic you're using. This code seems to have survived the transition to FF6.
>>
>>>>> Why would upgrading Firefox break this functionality?
>>
>>>>> My app works on all other browsers and platforms, but upgrading FF to
>>>>> version 6 breaks things? I don't understand.
> 

-- 
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to