Thursday, October 23, 2014

Re: Send event for keydown

This KeyPressHandler will change the text to upper case as the user types:

public class ForceUpperCase implements KeyPressHandler {
  public void onKeyPress(KeyPressEvent event) {
    final TextBoxBase tbb = (TextBoxBase) event.getSource();
    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
       public void execute() {


textBoxBase.addKeyPressHandler(new ForceUpperCase());

On Tuesday, October 21, 2014 7:49:57 AM UTC-4, Marteijn Nouwens wrote:
In a sub class for a textbox i try to convert lower case to upper case. This works ok but i would like to send the upper case as a Event.

// NativeEvent down = Document.get().createKeyDownEvent(false, false, true, false, keyCode);
// DomEvent.fireNativeEvent(down, this, this.getElement());

But this does not seem to trigger the browser event.

Now i do substring and set value. The user does not see this but i feel it's a bit overkill.

Anybody any ideas.?

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment