I work with Gxt. I need to set focus to the first allowed field on the page. But I have many pages, and I want to centralize this behavior. There is no documentation in Gxt, so I am wondering if anyone has encountered such a problem and can help me.
Now this happens in every component class.
protected void resetFocus() {
combobox.focus();
}
@Override
public void show() {
super.show();
resetFocus();
}
I found com.extjs.gxt.ui.client.aria.FocusManager, but it is completely unclear how I can use it. Or, perhaps you can also get a chain of fields, as they go along the component in accordance with the focus. And I can move the resetFocus method to the parent class.
Smth like this
protected void resetFocus() {
*getFocusChain().get(0).focus();*
}
source
share