1. #1
    Ext User
    Join Date
    May 2008
    Posts
    21
    Vote Rating
    0
    jtmille3 is on a distinguished road

      0  

    Default [FIXED] GXT Beta 3 SVN Build - Events.KeyPress Bug

    [FIXED] GXT Beta 3 SVN Build - Events.KeyPress Bug


    code below never gets fired. It did with Beta 2 build. I don't know what's changed.

    TextField<String> myTextField = new TextField<String>();
    myTextField
    .addListener(Events.KeyPress, new Listener() {
    publicvoid handleEvent(BaseEvent be) {
    }
    });

  2. #2
    Ext User
    Join Date
    May 2008
    Posts
    21
    Vote Rating
    0
    jtmille3 is on a distinguished road

      0  

    Default Fix...

    Fix...


    I applied a fix in my own build.

    In Field.class line 699 onKeyPress(FieldEvent fe) is stubbed out. It's being called correctly by method onComponentEvent, the observable is just never getting fired. If you guys apply this fix, can you also add KeyUp, and KeyDown events and fill in those methods in the Field class?

    protectedvoid onKeyPress(FieldEvent fe) {
    fireEvent(Events.
    KeyPress, new FieldEvent(this));

    }

  3. #3
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    Field now uses a KeyNav and fires the KeyPress event. I added the event to the javadocs. KeyPress is a application event that normalizes the browser key events. You can listen for the browser key up and browser key down using the GWT Event class. Fix is in SVN.
    Code:
    // app event
    field.addListener(Events.KeyPress, l);
    
    
    // browser event
    field.addListener(Event.ONKEYDOWN, l);
    // any GXT that begins with "On" is a browser event
    field.addListener(Events.OnKeyDown, l);

Thread Participants: 1