Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TabSet bug - when hide/show the single Tab, it is drawn without it's pane

    Hi all,
    we are using: SmartClient Version: v10.0p_2015-10-31/LGPL Development Only (built 2015-10-31).

    I found a quite tricky behavior of TabSet, when you hide the only (last visible) Tab and show it again, the Tab is drawn without it's pane.
    I attached a simple standalone test - easy to reproduce. TestTabSetMissingPane.java

    - there is a TabSet with two visible tabs. Show/Hide the tabs by checkboxes below the TabSet.
    UseCase1:
    - hide both
    - show/hide/show 1 > wrong, pane is missing

    UseCase2:
    - hide 1
    - hide 2
    - show 1 > ok, pane visible
    - hide 1
    - show 2 > ok, pane visible
    - hide 2
    - show 2 > wrong, pane is missing

    The "problem" seems to be in the TabSet.js in the function "_tabSelected". There is a part of code:

    Code:
    var isMoreTab = this.showMoreTab && this.tabBar.isShowingMoreTab() && tabObject == this.moreTab;
    if (!isMoreTab) {
    if (tabObject == this._selectedTabObj) return;
    this._selectedTabObj = tabObject;
    }
    The first tab to be shown is detected as the already selected one - drawing the pane is skipped.

    Thanks for any response...

    #2
    Just to add, maybe more comfortable, way to reproduce the problem (paste the following code to any example in Smartclient showcase):
    Code:
    var tab1 = {title: "Blue", icon: "pieces/16/pawn_blue.png", iconSize:16, pane: isc.Img.create({autoDraw: false, width: 48, height: 48, src: "pieces/48/pawn_blue.png"})};
    var tab2 = {title: "green", icon: "pieces/16/pawn_green.png", iconSize:16, pane: isc.Img.create({autoDraw: false, width: 48, height: 48, src: "pieces/48/pawn_green.png"})};
    
    isc.TabSet.create({
        ID: "tabSet",
        tabBarPosition: "top",
        width: 400,
        height: 200,
        destroyPanes:false,
        tabs: [tab1, tab2],
        updateTab1Visibility : function (visible) {
            if (visible) {
                tabSet.addTab(tab1,0);
            } else {
                tabSet.removeTab(tab1);
            }
        },
        updateTab2Visibility : function (visible) {
            if (visible) {
                tabSet.addTab(tab2);
            } else {
                tabSet.removeTab(tab2);
            }
        },
    });
    
    isc.DynamicForm.create({
        width: 400,
        top: 225,
        fields: [
            {title: "Show / Hide Tab 1", type: "checkbox", defaultValue:true, height: 25, change: "tabSet.updateTab1Visibility(value)"},
            {title: "Show / Hide Tab 2", type: "checkbox", defaultValue:true, height: 25, change: "tabSet.updateTab2Visibility(value)"}
        ]
    });
    Same usecases, same problem... or am I missing something?

    Comment


      #3
      We've made a change to address this issue. Please try the next nightly build, dated November 26.

      Regards
      Isomorphic Software

      Comment

      Working...
      X