1. #1
    Ext GWT Premium Member
    Join Date
    Sep 2008
    Posts
    327
    Vote Rating
    0
    rlaferla is on a distinguished road

      0  

    Default Getting input from a TextField

    Getting input from a TextField


    I have some basic questions about TextField:

    1. When the user presses "Enter" in a TextField, I want it to call a method in my controller. What event should I use? Please provide a code sample...

    2. Once in my controller code, what's the proper way to get the contents of the TextField?

    3. Where can I find documentation on which events do what for each widget? I'm using getRawValue() but I'm not sure if that is correct. I want all the text not just what is selected...


    btw - I did try listening for key press and it worked EXCEPT that I could not display a Dialog box if the field didn't validate. I suspect this has something to do with the fact that the key press was early in the event cycle (before the key up.)

  2. #2
    Ext User
    Join Date
    Oct 2008
    Location
    Warsaw(PL)/Cottbus(GER)
    Posts
    215
    Vote Rating
    0
    EagleEye666666 is on a distinguished road

      0  

    Default


    Quote Originally Posted by rlaferla View Post
    I have some basic questions about TextField:

    1. When the user presses "Enter" in a TextField, I want it to call a method in my controller. What event should I use? Please provide a code sample...

    2. Once in my controller code, what's the proper way to get the contents of the TextField?

    3. Where can I find documentation on which events do what for each widget? I'm using getRawValue() but I'm not sure if that is correct. I want all the text not just what is selected...


    btw - I did try listening for key press and it worked EXCEPT that I could not display a Dialog box if the field didn't validate. I suspect this has something to do with the fact that the key press was early in the event cycle (before the key up.)
    uhm, can't you use the search funct. of the forum?? or just open your eyes?? there is a post already and it is even active and quite new. there are a lot code examples
    ....

  3. #3
    Ext User
    Join Date
    Oct 2008
    Location
    Atlanta ,GA
    Posts
    239
    Vote Rating
    0
    kolli is on a distinguished road

      0  

    Default


    you can actually use the KeyNav class or the keyboardListener class to work on the listening keyboard events. You can have a look at what EagleEye was talking about..
    http://www.extjs.com/forum/showthread.php?t=50428

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,505
    Vote Rating
    53
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    http://extjs.com/deploy/dev/docs/?cl...member=keydown

    http://extjs.com/deploy/dev/docs/?cl...ember=keypress

    You will have to set the enableKeyEvents config option to true as mentioned there. That will be visible in the next release of the docs.

    Don't take EagleEye's comments to heart. These questions get asked time after time after time, and it sometimes feels as if nobody listens or is willing to read docs and just hack.. The docs now contain 99% of the information you need to get a standard Ext app running.

  5. #5
    Ext User
    Join Date
    Oct 2008
    Location
    Warsaw(PL)/Cottbus(GER)
    Posts
    215
    Vote Rating
    0
    EagleEye666666 is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    http://extjs.com/deploy/dev/docs/?cl...member=keydown

    http://extjs.com/deploy/dev/docs/?cl...ember=keypress

    You will have to set the enableKeyEvents config option to true as mentioned there. That will be visible in the next release of the docs.

    Don't take EagleEye's comments to heart. These questions get asked time after time after time, and it sometimes feels as if nobody listens or is willing to read docs and just hack.. The docs now contain 99% of the information you need to get a standard Ext app running.
    hej dont be to nice

    I'm not long here, even though i try to help. Sometimes it is just annoying
    I have rechecked the GXT API. There we just have a enableEvents(boolean true) method, which is inherited from class com.extjs.gxt.ui.client.widget.Component. But it is really necessary to turn that on? Isn't default true?

    regards

  6. #6
    Sencha Premium Member
    Join Date
    Dec 2008
    Location
    Munich, Germany
    Posts
    183
    Vote Rating
    0
    Jose Jeria is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by EagleEye666666 View Post
    There we just have a enableEvents(boolean true) method, which is inherited from class com.extjs.gxt.ui.client.widget.Component. But it is really necessary to turn that on? Isn't default true?
    The isDisabledEvents() method will answer this.