Hello guys,
How can I implement the focus method (Component.Focusable) on a CssLayout? This is what I’ve done so far:
public class FocusableLayout extends CssLayout implements Focusable {
@Override
public void focus() {
getUI().setFocusedComponent((Focusable) this);
}
@Override
public int getTabIndex() {
return 0;
}
@Override
public void setTabIndex(int tabIndex) {
}
}
It isn’t much and of course it doesn’t work. I’ve looked at classes that does support the focus method (e.g. Button) but I’m not sure I understand what’s going on. Especially for the getTabIndex and setTabIndex methods.
My goal is for the browser to be able to show the entire (if possible) CssLayout once its focus method is called (e.g. when the user clicks on a Button or Link).
Thanks for your help.