Hybrid View
-
12 Mar 2012 5:50 AM #1
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); } }
-
12 Mar 2012 6:23 AM #2
-
12 Mar 2012 6:41 AM #3
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?
-
12 Mar 2012 6:51 AM #4
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.
-
12 Mar 2012 7:01 AM #5
Boo. Premium memberships don't permit SVN read-only access for 3.0+, atleast I couldn't find the repository.
-
12 Mar 2012 8:05 AM #6
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...
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote