4 Replies Latest reply on Oct 2, 2008 1:01 PM by ntsiii

    Runtime Error #1010: A term is undefined.....

    Graeme_Smith Level 1
      Hello flex-experts.

      I recently migrated a multi-application project from flex 2 by simply importing the project folder into flex 3 builder, and compiling it in flex 3 (it does not have backward compatibility set and I don't want it set), however I am getting this error:

      ------------------------------------------------------------------------------------------ ----------------------------------------------------------------------
      TypeError: Error #1010: A term is undefined and has no properties.
      at mx.controls.listClasses::ListBase/makeRowsAndColumnsWithExtraRows()[E:\dev\3.1.0\framewor ks\projects\framework\src\mx\controls\listClasses\ListBase.as:1357]
      at mx.controls.listClasses::ListBase/updateDisplayList()[E:\dev\3.1.0\frameworks\projects\fr amework\src\mx\controls\listClasses\ListBase.as:3657]
      at mx.controls::List/updateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\c ontrols\List.as:1003]
      at mx.controls::Tree/updateDisplayList()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\c ontrols\Tree.as:1042]
      at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\ framework\src\mx\controls\listClasses\ListBase.as:3279]
      at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.1.0\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:605]
      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.1.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:678]
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.1.0\frameworks\projects\framework\sr c\mx\core\UIComponent.as:8565]
      at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.1.0\frameworks\projects\framework\src \mx\core\UIComponent.as:8508]
      ------------------------------------------------------------------------------------------ -------------------------------------------------------------------

      The error occurs when drilling down from a dashboard to view the metrics in a grid.

      The two terms which appear to be at fault when looking at the variables view in debug, are curY and oldContentHeight.

      Has anybody else come across this issue and found a way round it, or could this be a bug with a workaround available? Any help is greatly appreciated.

        • 1. Re: Runtime Error #1010: A term is undefined.....
          Graeme_Smith Level 1
          I forgot to mention this is an intermittent issue.
          • 2. Re: Runtime Error #1010: A term is undefined.....
            ntsiii Level 3
            I recently ran into this error with ADG. In my case, I am pretty sure it was a bug in ADG involving the locked columnCount and the columns array length: If the first column was locked, and the last column was visible, I would get this error. If I removed the locked column the problem went away. If I scroll horizontally so the last column was not visible, the problem went away.

            Now, my stack trace was different and gave me the clues about the locked column, but I don't see any clues in your stack trace.

            Sorry I am not more help.

            Tracy
            • 3. Re: Runtime Error #1010: A term is undefined.....
              Graeme_Smith Level 1
              Thankyou for your replies.

              I think I found my issue is with ListBase.as.
              As I drill down from the dashboard and try to expand a tree in the new app from the selected item in the dashboard, the error occurred on trying to expand the tree.

              I've tried various changes to the way expand the tree an select the item from the dashboard. I can now expand the tree to the selected item but the selected item doesn't select properly. If anybody can fill in the blanks for me I would be very grateful.

              my new code.... (selOrg being the selected item I want).....

              private function expandOrgs(node:XML):void
              {
              while (node.parent() != null)
              {
              node = node.parent();
              orgTree.expandItem(node, true, false);
              }
              }

              private function selectOrganization(selOrg:String):void
              {
              if (Application.application.IsActiveSession() == false)
              return;

              var selnode:XMLList = orgTreeData.descendants().(@label == selOrg);
              expandOrgs(selnode[0]);
              orgTree.selectedItem = selnode[0];

              var idx:int = orgTree.getItemIndex(selnode[0]);
              orgTree.validateNow();
              orgTree.scrollToIndex(idx);

              }

              Graeme.
              • 4. Re: Runtime Error #1010: A term is undefined.....
                ntsiii Level 3
                Often you can clear up selection issues by deferring the selectedItem assignment using callLater()

                Usually you need to do that after programatically assigning the dataProvider, to allow the control to update, before selecting anything. I can't tell if that applies to your case, but couldn't hurt to try.

                Be careful with indexes in trees.

                Tracy