Hello Isomorphic,
I have encountered an issue with Tabs reordering within a Tabset with addTabButton present.
With this setup, I am able to drag reposition a tab beyond the addTab button. On top of that, selecting the moved tab throws an exception and unexpected things happen with its associated pane.
Here is a test case which is just a slightly modified 'Closeable Tabs' showcase (https://www.smartclient.com/smartgwt...tabs_closeable):
Basically, the only real change is the addition of
Exception thrown when selecting the tab:
Observed in Chrome 73.0.3683.86
SmartClient Version: v12.0p_2018-08-25/Pro Deployment (built 2018-08-25)
Yes, the SmartGWT version is a bit outdated, but the latest issue regarding reordering in a tabset is from the beginning of 2017
(https://forums.smartclient.com/forum...add-tab-button).
But if this issue has been addressed in any later version, let me know and I will retest this.
Thanks
I have encountered an issue with Tabs reordering within a Tabset with addTabButton present.
With this setup, I am able to drag reposition a tab beyond the addTab button. On top of that, selecting the moved tab throws an exception and unexpected things happen with its associated pane.
Here is a test case which is just a slightly modified 'Closeable Tabs' showcase (https://www.smartclient.com/smartgwt...tabs_closeable):
Code:
public void onModuleLoad() { final TabSet topTabSet = new TabSet(); topTabSet.setCanReorderTabs(true); topTabSet.setCanAddTabs(true); topTabSet.setTabBarPosition(Side.TOP); topTabSet.setTabBarAlign(Side.LEFT); topTabSet.setWidth(600); topTabSet.setHeight(200); Tab tTab1 = new Tab("Blue"); tTab1.setCanClose(true); Canvas c1 = new Canvas(); c1.setBackgroundColor("blue"); tTab1.setPane(c1); Tab tTab2 = new Tab("Green"); Canvas c2 = new Canvas(); c2.setBackgroundColor("green"); tTab2.setPane(c2); topTabSet.addTab(tTab1); topTabSet.addTab(tTab2); HLayout buttons = new HLayout(); buttons.setMembersMargin(15); IButton addButton = new IButton("Add Tab"); addButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { String title = topTabSet.getTabs().length % 2 == 0 ? "Yellow" : "Green"; String iconType = topTabSet.getTabs().length % 2 == 0 ? "pawn" : "cube"; Tab tTab = new Tab(title); tTab.setCanClose(true); Canvas c = new Canvas(); c.setBackgroundColor(title.toLowerCase()); tTab.setPane(c); topTabSet.addTab(tTab); // Select the newly created Tab topTabSet.selectTab(tTab); } }); IButton removeButton = new IButton("Remove Tab"); removeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { topTabSet.removeTab(topTabSet.getTabs().length - 1); } }); buttons.addMember(addButton); buttons.addMember(removeButton); VLayout vLayout = new VLayout(); vLayout.setMembersMargin(15); vLayout.addMember(topTabSet); vLayout.addMember(buttons); vLayout.setHeight("auto"); vLayout.draw(); }
Code:
topTabSet.setCanReorderTabs(true); topTabSet.setCanAddTabs(true);
WARN:Log:TypeError: Cannot read property 'pane' of undefined
Stack from error.stack:
TabSet._tabSelected(<no args: exited>) on [TabSet ID:isc_TabSet_0] @ ISC_Containers.js:373:12
_3.buttonSelected(<no args: exited>) on [TabBar ID:isc_TabSet_0_tabBar] @ ISC_Containers.js:296:596
_3.setSelected(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Foundation.js:609:42
StatefulCanvas.select(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Foundation.js:181:150
StatefulCanvas.handleActivate(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Foundation.js:233:149
StatefulCanvas.handleClick(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Foundation.js:235:13
[c]Class.invokeSuper(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Core.js:313:93
[c]Class.Super(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Core.js:305:170
_3.handleClick(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Containers.js:46:135
[c]EventHandler.bubbleEvent(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:2134:89
[c]EventHandler.handleClick(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1974:50
EventHandler._handleMouseUp(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1959:11
[c]EventHandler.handleMouseUp(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1950:57
[c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object MouseEvent]) on [Class EventHandler] @ ISC_Core.js:2221:108
HTMLDocument.eval(event=>[object MouseEvent]) @ [no file]:3:123
Stack from error.stack:
TabSet._tabSelected(<no args: exited>) on [TabSet ID:isc_TabSet_0] @ ISC_Containers.js:373:12
_3.buttonSelected(<no args: exited>) on [TabBar ID:isc_TabSet_0_tabBar] @ ISC_Containers.js:296:596
_3.setSelected(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Foundation.js:609:42
StatefulCanvas.select(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Foundation.js:181:150
StatefulCanvas.handleActivate(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Foundation.js:233:149
StatefulCanvas.handleClick(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Foundation.js:235:13
[c]Class.invokeSuper(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Core.js:313:93
[c]Class.Super(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Core.js:305:170
_3.handleClick(<no args: exited>) on [SimpleTabButton ID:isc_Tab_3] @ ISC_Containers.js:46:135
[c]EventHandler.bubbleEvent(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:2134:89
[c]EventHandler.handleClick(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1974:50
EventHandler._handleMouseUp(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1959:11
[c]EventHandler.handleMouseUp(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:1950:57
[c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object MouseEvent]) on [Class EventHandler] @ ISC_Core.js:2221:108
HTMLDocument.eval(event=>[object MouseEvent]) @ [no file]:3:123
Observed in Chrome 73.0.3683.86
SmartClient Version: v12.0p_2018-08-25/Pro Deployment (built 2018-08-25)
Yes, the SmartGWT version is a bit outdated, but the latest issue regarding reordering in a tabset is from the beginning of 2017
(https://forums.smartclient.com/forum...add-tab-button).
But if this issue has been addressed in any later version, let me know and I will retest this.
Thanks
Comment