Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext GWT Premium Member
    Join Date
    Dec 2011
    Location
    Earth
    Posts
    228
    Vote Rating
    1
    nbuesing is on a distinguished road

      0  

    Default Cannot give focus to button on dialog

    Cannot give focus to button on dialog


    I am trying to give focus to the close button of a dialog, when the dialog is displayed. Nothing I do works. Once the dialog is displayed and I press space-bar or enter key, the main button's select event (that had the focus to display the dialog) is being called.

    I have provided a test case. If you see comments in my overridden show method, I have tried a variety of ways on calling the focus() method for the button (directly, with scheduled deferred, with scheduled finally, etc).

    Internet Explorer 8
    Chrome 24
    Windows 7, 64 Bit
    GWT 2.4 / Developer Mode

    FocusIssue.zip

    Thanks.

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Posts
    23
    Vote Rating
    0
    Andreas Samjeske is on a distinguished road

      0  

    Default


    Same here.
    I have a TextButton with a SelectHandler. OnSelect a Dialog is created and show() is called.
    Afaics, this should bring focus to the first Button of the ButtonBar of the Dialog. Thats NOT the case. Hitting spacebar creates and opens a similar Dialog, since focus is still on the TextButton I klicked.

    Even calling focus on the Dialog or one of its Buttons in a deffered scheduler has no effect.

    - GXT Version 3.0.0b
    - FireFox 17.0.3
    - Windows 7
    - DevMode


    This issue might be related to
    http://www.sencha.com/forum/showthread.php?249092
    Last edited by Andreas Samjeske; 6 Mar 2013 at 5:39 AM. Reason: Referencing similar issue

  3. #3
    Sencha User
    Join Date
    Aug 2008
    Posts
    19
    Vote Rating
    0
    GrecoRS4 is on a distinguished road

      0  

    Default


    Have you tried the setFocusWidget(Widget widget) method. It works for me to provide focus to widgets within a window/dialog. I also make use of the setTabIndex(int) for each of my widgets in the dialog/window to make sure tabbing flows correctly.

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Posts
    23
    Vote Rating
    0
    Andreas Samjeske is on a distinguished road

      0  

    Default


    Quote Originally Posted by GrecoRS4 View Post
    Have you tried the setFocusWidget(Widget widget) method. It works for me to provide focus to widgets within a window/dialog. I also make use of the setTabIndex(int) for each of my widgets in the dialog/window to make sure tabbing flows correctly.
    Yep, in the process of finding a workaround I discovered setPredefinedButtons() calls setFocusWidget(FirstOneofTheButtons). That leads to the issue stated above.

    Calling setFocusWidget(null) or setFocusWidget(AnyOtherWidgetNOTBeingAPredefinedButton) solves the issue.