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

    JS error for TabSet with no tabs instead of expected Developer Console message

    Hi Isomorphic,

    though a configuration error on my side I tried to create a TabSet with no tabs. This of course does not make sense, but should not end in a JS error, but an error message in the Developer Console IMHO. This left me wondering what is happening for quite some time.
    Please see this online sample (v11.1p_2018-07-10):
        ID: "topTabSet",
        autoDraw: false,
        tabBarPosition: "top",
        width: 400,
        height: 200,
        tabs: [
        membersMargin: 15,
        members: [
    Developer Console result:
    14:29:36.402:MUP2:WARN:drawing:topTabSet_tabBar_baseLine:negative or zero area: height: 1, width: 0, refusing to draw
        Canvas.readyToDraw() on [Canvas ID:topTabSet_tabBar_baseLine] @ ISC_Core.js:2520:188
        Canvas.draw(_1=>undef) on [Canvas ID:topTabSet_tabBar_baseLine] @ ISC_Core.js:2529:94
        Layout._drawNonMemberChildren() on [TabBar ID:topTabSet_tabBar] @ ISC_Foundation.js:268:63
        Layout.drawChildren() on [TabBar ID:topTabSet_tabBar] @ ISC_Foundation.js:265:670
        Canvas.draw(<no args: recursion>)  on [TabBar ID:topTabSet_tabBar] @ ISC_Core.js:2541:253
        [c]Class.invokeSuper(_1=>[Class Toolbar], _2=>"draw", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef, _11=>undef, _12=>undef, _13=>undef) on [TabBar ID:topTabSet_tabBar] @ ISC_Core.js:302:162
        Toolbar.draw(_1=>undef, _2=>undef, _3=>undef, _4=>undef) on [TabBar ID:topTabSet_tabBar] @ ISC_Foundation.js:611:493
        [c]Class.invokeSuper(<no args: recursion>)  on [TabBar ID:topTabSet_tabBar] @ ISC_Core.js:302:162
        TabBar.draw(_1=>undef, _2=>undef, _3=>undef, _4=>undef) on [TabBar ID:topTabSet_tabBar] @ ISC_Containers.js:61:297
        Canvas.drawChildren() on [TabSet ID:topTabSet] @ ISC_Core.js:2587:241
        Canvas.draw(<no args: recursion>)  on [TabSet ID:topTabSet] @ ISC_Core.js:2541:253
        [c]Class.invokeSuper(<no args: recursion>)  on [TabSet ID:topTabSet] @ ISC_Core.js:302:162
        TabSet.draw(_1=>undef, _2=>undef, _3=>undef, _4=>undef) on [TabSet ID:topTabSet] @ ISC_Containers.js:310:6
        Layout.layoutChildren(_1=>"initial draw", _2=>undef, _3=>undef) on [VStack ID:isc_VStack_0] @ ISC_Foundation.js:356:264
        Layout.drawChildren(<no args: recursion>)  on [VStack ID:isc_VStack_0] @ ISC_Foundation.js:265:640
        Canvas.draw(<no args: recursion>)  on [VStack ID:isc_VStack_0] @ ISC_Core.js:2541:253
        Canvas.addChild(_1=>[VStack ID:isc_VStack_0], _2=>null, _3=>true) on [Canvas ID:featureExplorer_exampleViewer_exampleViewPane_viewContainer] @ ISC_Core.js:2744:4
        ExampleViewer.addCanviiToView(_1=>Array[6]) on [ExampleViewer ID:featureExplorer_exampleViewer] @ ISC_ExampleViewer.js:95:97
        ExampleViewer.evalExample(_1=>"isc.TabSet.create({\n    ID: "topTabSet",..."[240]) on [ExampleViewer ID:featureExplorer_exampleViewer] @ ISC_ExampleViewer.js:91:546
        ExampleViewer.showExample(_1=>undef) on [ExampleViewer ID:featureExplorer_exampleViewer] @ ISC_ExampleViewer.js:91:61
        ExampleSourcePane.tryEditedCode() on [ExampleSourcePane ID:featureExplorer_exampleViewer_exampleSourcePane] @ ISC_ExampleViewer.js:110:1947
        SourceEditor.tryClicked(_1=>undef) on [SourceEditor ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor] @ ISC_ExampleViewer.js:114:491
        _3.eval(event=>Obj, eventInfo=>undef) on [IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton] @ [no file]:3:35
        StatefulCanvas.handleActivate(_1=>Obj, _2=>undef) on [IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton] @ ISC_Foundation.js:235:108
        StatefulCanvas.handleClick(_1=>Obj, _2=>undef) on [IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton] @ ISC_Foundation.js:236:13
        [c]EventHandler.bubbleEvent(_1=>[IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton], _2=>"click", _3=>undef, _4=>undef, _5=>undef) on [Class EventHandler] @ ISC_Core.js:2063:89
        [c]EventHandler.handleClick(_1=>[IButton ID:featureExplorer_exampleViewer_exampleSourcePane_sourceEditor_sourceEditorToolbar_tryItButton], _2=>undef) on [Class EventHandler] @ ISC_Core.js:1916:50
        EventHandler._handleMouseUp(_1=>[object MouseEvent], _2=>undef) on [Class EventHandler] @ ISC_Core.js:1901:11
        [c]EventHandler.handleMouseUp(_1=>[object MouseEvent], _2=>undef) on [Class EventHandler] @ ISC_Core.js:1892:57
        [c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object MouseEvent]) on [Class EventHandler] @ ISC_Core.js:2149:108
        HTMLDocument.eval(event=>[object MouseEvent]) @ [no file]:3:123
    Best regards

    well, it is a warning, isn't it?


      Hi claudiobosticco

      yes, you are right. But it looks like an error (I did not notice it was a warning) because of the stack trace. Also, it displays no good reason, which it should know.

      Best regards


        Thanks for the notification.
        We can make sure there's a more intuitive warning here.
        Since this issue will have no user-visible ill effects we'll be making this change in mainline (12.1d branch) only.


          Hi Isomorphic,

          I do see this now in 12.1d (SNAPSHOT_v12.1d_2018-07-12):
          [B]16:11:34.262:MUP8:WARN:TabSet:topTabSet:This TabSet has no specified tabs.[/B]
          16:11:34.278:MUP8:WARN:drawing:topTabSet_tabBar_baseLine:negative or zero area: height: 1, width: 0, refusing to draw
              Canvas.readyToDraw() on [Canvas ID:topTabSet_tabBar_baseLine] @ ISC_Core.js:2594:188
              Canvas.draw(_1=>undef) on [Canvas ID:topTabSet_tabBar_baseLine] @ ISC_Core.js:2603:94 ...


            Hello again,

            having a look at this sample, a TabSet without tabs is working, if the tabs get removed after draw.
            Perhaps a TabSet without Tabs should also be working at start.

            Use case:
            Window showing company data
            • TabSet
              • Tab Masterdata
              • Tab Contact persons
                • TabSet
                  • Tab Person 1
                  • Tab Person 2
                  • Tab Person n
            At start the latter TabSet will be empty. One could hit a plus button like in sample #layout_tabs_custom_controls.
            This will not work right now, or at least create the two warnings.

            Another note: The mentioned sample #layout_tabs_custom_controls is only there in SmartGWT, not in SmartClient.

            Best regards


              In terms of user-visible functionality, creating and drawing a TabSet with no initial tabs and then adding them at runtime post-create will not cause any ill effects.
              It's an unusual user experience as the tabset will essentially be a blank rectangle initially with no informative content, but there's nothing inherently unsupported about doing this, so essentially this comes down to a request to get rid of the warning about the baseLine initially having zero width in this case.

              We'll look into making this change (again, in 12.1d only), but you can use this pattern in the meantime if you have a use case where it is required.

              *UPDATE: We've now made this change in 12.1d, so the zero-size warning plus stack trace will not show up in nightly builds going forward if you draw a tabset with no initial tabs
              Last edited by Isomorphic; 12 Jul 2018, 10:32.