Gwt tabindex inside a dialog box

In my gwt application, on some screens I create a dialog box with an input form. I would like to be able to use the tabindex property, but only in this dialog box. (i.e.: first selects the first and last field of this dialog box). Right now, if I click on a tab when the last field is selected, the focus will move to the first index of the tab, which is the item behind the dialog box (set like glass). This is quite annoying, because now you need to enter a tab several times until the focus returns to the first field of the dialog box. Setting the dialog box to modality mode is even worse, because as soon as you go outside the dialog box, the tab key is ignored, because objects outside the dialog box no longer receive keyboard events (cannot be displayed!).Is my only way to listen to the tab key and tabbing knob manually? I would be happy if the tab extends beyond my application and to the URL bar (for example) while it returns to my dialog box without having to go through all the elements below it.

+3
source share
2 answers

Well, after almost a month without an answer, I decided to go with manual key management for the tabs. Works like a charm, but now it ignores the url string in the tab loop (different from me). I used this blog post to go: http://albertattard.blogspot.com/2009/11/capturing-tab-key-in-gwt-textarea.html I just added a focus panel to the root of my dialog.

+1
source

Good, better late than never! I had the same problem. The solution is actually quite simple.

, , Composite . , . . , (setTabIndex(-1)), .

:

this.addAttachHandler( new AttachEvent.Handler() {
    @Override
    public void onAttachOrDetach(AttachEvent event) {
        if(isAttached()) {
            setTabOrder();
        } else {
            clearTabOrder();
        }               
    }
});

setTabOrder() clearTabOrder(), . , GWT . , , /.

+3
source

Source: https://habr.com/ru/post/1763525/


All Articles