Hi,
I found that there is probably bug in SmartGWT implementation in class com.smartgwt.client.widgets.tab.Tab, method getTabCanvas(). This method does not create Canvas through ObjectFactory even if there could be different Tab implementations (ImgTab or Button). It always returns and registers StatefulCanvas instance.
In some cases it leads to ClassCastException fired from Button.getOrCreateRef() or ImgTab.getOrCreateRef().
Use such tabset and try to switch between tabs, it leads to ClassCastException in onTabSelected handler:
Am I right, that such implementation in Tab.getTabCanvas() is not correct? Can you make a fix? Now we have to completely override standard method Tab.getTabCanvas().
Thanks!
SmartClient: v10.0p_2015-03-19/LGPL Development Only (built 2015-03-19)
browser: IE11
I found that there is probably bug in SmartGWT implementation in class com.smartgwt.client.widgets.tab.Tab, method getTabCanvas(). This method does not create Canvas through ObjectFactory even if there could be different Tab implementations (ImgTab or Button). It always returns and registers StatefulCanvas instance.
In some cases it leads to ClassCastException fired from Button.getOrCreateRef() or ImgTab.getOrCreateRef().
Use such tabset and try to switch between tabs, it leads to ClassCastException in onTabSelected handler:
Code:
final Canvas cnv1 = new Canvas(); cnv1.setContents("111111111111"); final Canvas cnv2 = new Canvas(); cnv2.setContents("222222222222"); TabSet tabset = new TabSet(); final Tab tab1 = new Tab(); final Tab tab2 = new Tab(); tab1.setTitle("TEST-1"); tab1.setPane(cnv1); tab2.setTitle("TEST-2"); tab2.setPane(cnv2); tabset.setWidth100(); tabset.setHeight100(); tabset.addTabSelectedHandler(new TabSelectedHandler() { @Override public void onTabSelected(TabSelectedEvent event) { try { event.getTab().getTabCanvas(); EventHandler.getTarget(); } catch (Throwable t ) { SC.say("EXCEPTION! " + t); } } }); tabset.addTab(tab1); tabset.addTab(tab2);
Thanks!
SmartClient: v10.0p_2015-03-19/LGPL Development Only (built 2015-03-19)
browser: IE11
Comment