-
20 Mar 2012 2:05 AM #11
@bbg: Well, being new to GWT development, I haven't used much Cells yet. If you have a sample code to share (how to add it to a Sencha text field), I would be glad.
Beside, I stands by my point: it makes, if not really "hard", non obvious to have this very common functionality.
-
9 Apr 2012 12:34 PM #12
Well I ended up overriding ComboBoxCell and TextInputCell to do the following:
ComboBoxCell instead of String, you'll want to type cast with T.
Where, EnterKeyDownEvent looks like so:Code:@Override protected void onEnterKeyDown(Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater) { super.onEnterKeyDown(context, parent, value, event, valueUpdater); fireEvent(new EnterKeyDownEvent()); }
Then just add a handler on the cell for the enterKeyDownEvent.Code:import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.EventHandler; public class EnterKeyDownEvent extends GwtEvent<EnterKeyDownEventHandler> { public static Type<EnterKeyDownEventHandler> TYPE = new Type<EnterKeyDownEventHandler>(); public EnterKeyDownEvent() {} @Override protected void dispatch(EnterKeyDownEventHandler handler) { handler.enterDown(this); } @Override public Type<EnterKeyDownEventHandler> getAssociatedType() { return TYPE; } public interface EnterKeyDownEventHandler extends EventHandler { void enterDown(EnterKeyDownEvent event); } }
-
9 Apr 2012 12:41 PM #13
Just a thought, it would be nice if someone added this functionality into the core AbstractEventInputCell, then you wouldn't have to override for every cell type class.
-
10 Apr 2012 5:42 AM #14
@mtraynham: many thanks, it works well!
Indeed, it would be nice to have that in the core. I had to make a TextInputCell and a PasswordinputCell overriding onEnterKeyDown as you shown, to create the handler with the login action, to attach the handler to the cells and to create the input fields with the cells as parameters. A bit convoluted... But it works!
-
13 Apr 2012 6:00 AM #15
Please let me know if it is added to the core?
-
14 Jun 2012 8:08 AM #16
Hi,
I have the same bug in the final version !
Will you correct it or not ?
Thanks.
-
29 Jun 2012 6:23 AM #17
+1
Waiting for a fix. Even if the workaround is easy
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote