Announcement

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

    [bug] TabSet error after migration 8.3 -> 9.0

    SmartClient Version: v9.0p_2013-07-16/EVAL Development Only (expires 2013.09.14_09.07.29)

    I've got an error "Uncaught TypeError: Cannot read property 'parentElement' of undefined" in ISC_Containers.js?isc_version=v90p_2013-07-16.js:10372
    Code:
    isc.SimpleTabButton.addProperties({
    
        // Override the default width of 100 set on button
    
        width:null,
        height:null,
    
        setIcon : function (icon) {
            var tabset = this.parentElement.parentElement;
            if (!tabset.canCloseTabs && tabset.useIOSTabs) {
                // Make sure a previous icon is replaced
                this.iOSIcon = null;
            }
            this.Super("setIcon", arguments);
        },
        getTitle : function () {
            var tabset = this.parentElement.parentElement;
    
    // throws Uncaught TypeError: Cannot read property 'parentElement' of undefined
    It happens on a call to animateShow on a tab after 'initWidget' of the tab itself. In 8.3 it was working.
    I tried to reproduce it in the showCase and I raises the same error:
    Code:
    ErrorType: TypeError
    ErrorMessage: Cannot read property 'parentElement' of undefined
    you can try it in the #tabsOrientation sample, modified like this:
    Code:
    isc.TabSet.create({
        ID: "topTabSet",
        tabBarPosition: "top",
        width: 400,
        height: 200,
        tabs: [
            {title: "Blue", icon: "pieces/16/pawn_blue.png", iconSize:16,
              visibility:"hidden",
              initWidget: function () {
                    this.Super("initWidget", arguments);
                    this.animateShow();
                },
             pane: isc.Img.create({autoDraw: false, width: 48, height: 48, src: "pieces/48/pawn_blue.png"})
    },
            {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"})}
        ]
    });
    and this test case works with 8.3
    Last edited by claudiobosticco; 18 Jul 2013, 07:38.

    #2
    This probably indicates getTitle() is being called before the tab is being added to the TabSet (which would be considered normal). In this case, parentElement would be null, and adding a null check to your logic will probably correct the issue.

    Comment


      #3
      thanks for your quick reply, I must specify that I've got this error with Chrome 28.0.1500.71 on Mac OSX and not with IE10 on Win7

      I think that's your code which needs a null check in the getTitle method, my code is only calling show (after initWidget) on the tab, and this is the stack trace from chrome dev console (I call show in 'checkAbilitazione' which is called in the initWidget override):
      Code:
      isc.SimpleTabButton.addProperties.getTitle (ISC_Containers.js?isc_version=v90p_2013-07-16.js:10372)
      isc.StatefulCanvas.addMethods.getTitleHTML (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:3724)
      isc.Class.addClassMethods.invokeSuper (ISC_Core.js?isc_version=v90p_2013-07-16.js:5407)
      isc.Button.addMethods.getTitleHTML (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:9304)
      isc.Button.addMethods.fillInCell (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:9111)
      isc.Button.addMethods.getInnerHTML (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:8873)
      isc.Canvas.addMethods._getInnerHTML (ISC_Core.js?isc_version=v90p_2013-07-16.js:40386)
      isc.Canvas.addMethods._insertHTML (ISC_Core.js?isc_version=v90p_2013-07-16.js:41711)
      isc.Canvas.addMethods.draw (ISC_Core.js?isc_version=v90p_2013-07-16.js:40737)
      isc.StatefulCanvas.addMethods.draw (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:3650)
      isc.Canvas.addMethods.animateShow (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:1085)
      isc.TabSet.create.tabs.checkAbilitazione (everyRole.js?1374145998000:9071)
      isc.TabSet.create.tabs.initWidget (everyRole.js?1374145998000:9084)
      isc.Canvas.addMethods.init (ISC_Core.js?isc_version=v90p_2013-07-16.js:39985)
      isc.Class.addMethods.completeCreation (ISC_Core.js?isc_version=v90p_2013-07-16.js:6302)
      isc.Class.addClassMethods.create (ISC_Core.js?isc_version=v90p_2013-07-16.js:4101)
      isc.Toolbar.addMethods._makeItem (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:12208)
      isc.Toolbar.addMethods.makeButton (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:12188)
      isc.Class.addClassMethods.invokeSuper (ISC_Core.js?isc_version=v90p_2013-07-16.js:5407)
      isc.TabBar.addMethods.makeButton (ISC_Containers.js?isc_version=v90p_2013-07-16.js:511)
      isc.Toolbar.addMethods.setButtons (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:12116)
      isc.Class.addClassMethods.invokeSuper (ISC_Core.js?isc_version=v90p_2013-07-16.js:5401)
      isc.Class.addClassMethods.Super (ISC_Core.js?isc_version=v90p_2013-07-16.js:5219)
      isc.TabBar.addMethods.setButtons (ISC_Containers.js?isc_version=v90p_2013-07-16.js:480)
      isc.Toolbar.addMethods.draw (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:11758)
      isc.Class.addClassMethods.invokeSuper (ISC_Core.js?isc_version=v90p_2013-07-16.js:5407)
      isc.TabBar.addMethods.draw (ISC_Containers.js?isc_version=v90p_2013-07-16.js:620)
      isc.Canvas.addMethods.drawChildren (ISC_Core.js?isc_version=v90p_2013-07-16.js:41591)
      isc.Canvas.addMethods.draw (ISC_Core.js?isc_version=v90p_2013-07-16.js:40743)
      isc.Class.addClassMethods.invokeSuper (ISC_Core.js?isc_version=v90p_2013-07-16.js:5407)
      isc.TabSet.addMethods.draw (ISC_Containers.js?isc_version=v90p_2013-07-16.js:10861)
      isc.Layout.addMethods.layoutChildren (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:6185)
      isc.Layout.addMethods.drawChildren (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:5115)
      isc.Canvas.addMethods.draw (ISC_Core.js?isc_version=v90p_2013-07-16.js:40743)
      isc.Layout.addMethods.layoutChildren (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:6146)
      isc.Layout.addMethods.drawChildren (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:5115)
      isc.Canvas.addMethods.draw (ISC_Core.js?isc_version=v90p_2013-07-16.js:40743)
      isc.Layout.addMethods.layoutChildren (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:6146)
      isc.Layout.addMethods.drawChildren (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:5115)
      isc.Canvas.addMethods.draw (ISC_Core.js?isc_version=v90p_2013-07-16.js:40743)
      isc.Layout.addMethods.layoutChildren (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:6146)
      isc.Layout.addMethods.drawChildren (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:5115)
      isc.Canvas.addMethods.draw (ISC_Core.js?isc_version=v90p_2013-07-16.js:40743)
      isc.Layout.addMethods.layoutChildren (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:6185)
      isc.Layout.addMethods.reflowNow (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:6421)
      (anonymous function) (ISC_Foundation.js?isc_version=v90p_2013-07-16.js:6404)
      isc.EventHandler.addClassMethods.runTeas (ISC_Core.js?isc_version=v90p_2013-07-16.js:31645)
      isc.EventHandler.addClassMethods._clearThread (ISC_Core.js?isc_version=v90p_2013-07-16.js:31613)
      isc.Timer.addClassMethods._fireTimeout (ISC_Core.js?isc_version=v90p_2013-07-16.js:25920)
      (anonymous function) ([VM]  (64830):1)
      I'm not calling getTitle nor parentElement.

      Comment


        #4
        This is fixed for 9.0 builds dated July 20 and later

        Comment


          #5
          SmartClient Version: v9.0p_2013-07-20/EVAL Deployment

          verified, thank you very much.

          Comment

          Working...
          X