Tabindex question

Hi everybody,
I’m very new to vaadin framework.



textboxes are added to a gridlayout

when I test the tabindex into the browser (mozilla firefox), I press tab key and when I arrive to txt3 and press tab again the browser steals focus.

It there any solution to make txt1 get focus after txt3?

Thank you very much, vaadin is great


I think you could add a BlurListener to txt3 and call txt1.focus() from there. This will have some unwanted consequences also, but can’t think of another way.

Thank you very much for your reply.

Can’t use BlurListener because I have two buttons (OK, Cancel) at the end of the form and they need TabIndex too.

Also, if a user clicks to another field (or presses ALT+SHIFT) the behavior would be compromised.

Maybe this problem can’t be solved as of Vaadin’s intrinsic web oriented nature.

I should try at last custom javascript (intercept when click tab and btnCancel has focus). I’ll try and let you know.

Yeah, you can’t really fix it properly from just the server-side. If you go the GWT side I think it could be possible. Although I’m not sure if you actually can cancel the focus-change event when the focus would go back to the browser controls. This might even be browser dependent. At least some native events in some browsers cannot be cancelled.

If you get any results, please do post them for others to enjoy :slight_smile:

btnLogin.addListener(new BlurListener() {
public void blur(BlurEvent event) {

This code works in Opera and Safari.