Uncaught client side exception when focusing component

Hi,

we’re getting a client side exception from TabSheet when calling focus() on a component located in a tab which is currently not selected.

Error message:

JavaScriptException: (TypeError) : Cannot call method 'Rd' of undefined

Sample code (beta9):

TextField tf = new TextField();
tf.focus();
TabSheet tabs = new TabSheet();
tabs.addTab(new VerticalLayout(), "tab1");
tabs.addTab(new VerticalLayout(tf), "tab2");

I guess that focusing a field which is currently not visible is not what one should do, but it was automatically done by our code when building a multitab page with custom components so we ended up hitting this exception anyway. We’ll change our code to avoid playing tricks on the framework, but there’s maybe a missing check in Vaadin that you might want to fix, too - this should fail silently without raising exceptions.