Hybrid View

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    70
    Vote Rating
    6
    mtraynham is on a distinguished road

      0  

    Default GXT 3.0 Beta 4, ValueBaseField not capturing KeyUp or KeyPress events for Enter Key

    GXT 3.0 Beta 4, ValueBaseField not capturing KeyUp or KeyPress events for Enter Key


    This worked in 3.0 Beta 3. Try the code:

    Code:
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.event.dom.client.KeyCodes;
    import com.google.gwt.event.dom.client.KeyUpEvent;
    import com.google.gwt.event.dom.client.KeyUpHandler;
    import com.google.gwt.user.client.Window;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.sencha.gxt.widget.core.client.form.TextField;
    
    public class TestEnterKey implements EntryPoint {
        public void onModuleLoad() {
            TextField textField = new TextField();
            textField.addKeyUpHandler(new KeyUpHandler() {
                public void onKeyUp(KeyUpEvent event) {
                    if(event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                        Window.alert("Enter key pressed");
                    }
                }
            });
            RootPanel.get().add(textField);
        }
    }

  2. #2
    Sencha User PhiLho's Avatar
    Join Date
    Nov 2011
    Location
    Near Paris, France
    Posts
    140
    Vote Rating
    1
    PhiLho is on a distinguished road

      0  

    Default


    Related: KeyPressEvent UiHandler no longer works in Beta4
    KeyUp wasn't working for me in Beta 3...

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    70
    Vote Rating
    6
    mtraynham is on a distinguished road

      0  

    Default


    Ahh thanks for the post. I believe it was working for me in Beta 3, I'll check for clarification. Debugging it a bit, doesn't seem like this event is fired at a lower level of ValueBasedField, (Field<T>). Possible focus wonkiness here?

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    70
    Vote Rating
    6
    mtraynham is on a distinguished road

      0  

    Default


    Well it does work in Beta 3, but there is an issue with focus and Enter. You can type whatever into the field and the event works fine, yet Enter is not captured, unless you mouse click the text field again (refocus).

    Beta 4 doesn't capture Enter at all. Will try with Trunk SVN.

  5. #5
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    70
    Vote Rating
    6
    mtraynham is on a distinguished road

      0  

    Default


    Boo. Premium memberships don't permit SVN read-only access for 3.0+, atleast I couldn't find the repository.

  6. #6
    Sencha User PhiLho's Avatar
    Join Date
    Nov 2011
    Location
    Near Paris, France
    Posts
    140
    Vote Rating
    1
    PhiLho is on a distinguished road

      0  

    Default


    Yes, by "not working for me in Beta 3", I meant it wasn't usable for this usage, exactly for the scenario you describe (need to hit Enter twice with refocus). I was happy to see that keyPressed worked, but this one was broken too in Beta4.

    The TextButton Focus / Tab Index Issue topic is somehow related...