3 Replies Latest reply on Sep 22, 2009 9:05 AM by vialisk

    Embedding a list or datagrid within a datagrid - "A term is undefined and has no properties."

    crissy84 Level 1

      Hi,

      Strange problem here.  I recently upgraded to Flex SDK 3.4 and I'm pretty sure that's when this problem started happening.  I've simplified it down to this example of embedding a List as an itemRenderer in a datagrid... which gives an error "A term is undefined and has no properties.".  Any idea what the deal is?

       

      Thanks!

       

      <mx:DataGrid dataProvider="{[{label:'a',children:[{label:'b'},{label:'c'}]}]}">

           <mx:columns>

                <mx:DataGridColumn dataField="label"/>

                <mx:DataGridColumn dataField="children">

                     <mx:itemRenderer>

                          <mx:Component>

                               <mx:List dataProvider="{data.children}">

                                    <mx:itemRenderer>

                                         <mx:Component>

                                              <mx:Label text="{data.label}"/>

                                         </mx:Component>

                                    </mx:itemRenderer>

                               </mx:List>

                          </mx:Component>

                     </mx:itemRenderer>

                </mx:DataGridColumn>

           </mx:columns>

      </mx:DataGrid>

       

       

      TypeError: Error #1010: A term is undefined and has no properties.

           at mx.controls.listClasses::ListBase/setSelectionDataLoop()[C:\autobuild\galaga\frameworks\p rojects\framework\src\mx\controls\listClasses\ListBase.as:6473]

           at mx.controls.listClasses::ListBase/commitSelectedItems()[C:\autobuild\galaga\frameworks\pr ojects\framework\src\mx\controls\listClasses\ListBase.as:6364]

           at mx.controls.listClasses::ListBase/commitSelectedItem()[C:\autobuild\galaga\frameworks\pro jects\framework\src\mx\controls\listClasses\ListBase.as:6329]

           at mx.controls.listClasses::ListBase/adjustSelectionSettings()[C:\autobuild\galaga\framework s\projects\framework\src\mx\controls\listClasses\ListBase.as:4014]

           at mx.controls.listClasses::ListBase/updateDisplayList()[C:\autobuild\galaga\frameworks\proj ects\framework\src\mx\controls\listClasses\ListBase.as:3748]

           at mx.controls::List/updateDisplayList()[C:\autobuild\galaga\frameworks\projects\framework\s rc\mx\controls\List.as:1005]

           at mx.controls.listClasses::ListBase/validateDisplayList()[C:\autobuild\galaga\frameworks\pr ojects\framework\src\mx\controls\listClasses\ListBase.as:3348]

           at mx.managers::LayoutManager/validateClient()[C:\autobuild\galaga\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:880]

           at mx.core::UIComponent/validateNow()[C:\autobuild\galaga\frameworks\projects\framework\src\ mx\core\UIComponent.as:5679]

           at mx.controls.dataGridClasses::DataGridBase/updateRendererDisplayList()[C:\autobuild\galaga \frameworks\projects\framework\src\mx\controls\dataGridClasses\DataGridBase.as:1184]

           at mx.controls.dataGridClasses::DataGridBase/drawItem()[C:\autobuild\galaga\frameworks\proje cts\framework\src\mx\controls\dataGridClasses\DataGridBase.as:1154]

           at mx.controls.dataGridClasses::DataGridBase/drawVisibleItem()[C:\autobuild\galaga\framework s\projects\framework\src\mx\controls\dataGridClasses\DataGridBase.as:1127]

           at mx.controls.dataGridClasses::DataGridBase/makeRows()[C:\autobuild\galaga\frameworks\proje cts\framework\src\mx\controls\dataGridClasses\DataGridBase.as:708]

           at mx.controls.dataGridClasses::DataGridBase/makeRowsAndColumns()[C:\autobuild\galaga\framew orks\projects\framework\src\mx\controls\dataGridClasses\DataGridBase.as:593]

           at mx.controls::DataGrid/makeRowsAndColumns()[C:\autobuild\galaga\frameworks\projects\framew ork\src\mx\controls\DataGrid.as:1545]

           at mx.controls.listClasses::ListBase/makeRowsAndColumnsWithExtraRows()[C:\autobuild\galaga\f rameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:1380]

           at mx.controls.listClasses::ListBase/updateDisplayList()[C:\autobuild\galaga\frameworks\proj ects\framework\src\mx\controls\listClasses\ListBase.as:3726]

           at mx.controls.dataGridClasses::DataGridBase/updateDisplayList()[C:\autobuild\galaga\framewo rks\projects\framework\src\mx\controls\dataGridClasses\DataGridBase.as:581]

           at mx.controls::DataGrid/updateDisplayList()[C:\autobuild\galaga\frameworks\projects\framewo rk\src\mx\controls\DataGrid.as:1444]

           at mx.controls.listClasses::ListBase/validateDisplayList()[C:\autobuild\galaga\frameworks\pr ojects\framework\src\mx\controls\listClasses\ListBase.as:3348]

           at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\galaga\frameworks\projects\ framework\src\mx\managers\LayoutManager.as:622]

           at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\galaga\frameworks\project s\framework\src\mx\managers\LayoutManager.as:695]

           at Function/http://adobe.com/AS3/2006/builtin::apply()

           at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\galaga\frameworks\projects\frame work\src\mx\core\UIComponent.as:8733]

           at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\galaga\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8673]

        • 1. Re: Embedding a list or datagrid within a datagrid - "A term is undefined and has no properties."
          Flex harUI Adobe Employee

          You might see this in 3.4 if selectedItem is set to an item that isn't in the dataProvider.  I don't see selectedItem being set in the example you posted.  Did you post the actual MXML?

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: Embedding a list or datagrid within a datagrid - "A term is undefined and has no properties."
            crissy84 Level 1

            Hi Alex,

            Thanks for the reply.

            To answer your questions, yes, that is the acual MXML.  I dropped that into two completely different apps and got the same error.  And selectedItem was not being set (at least not by me) in any of those.

             

            After my original post, I started working in another app and got the same error  when a List was created under a completely different scenario.  Long story short, I rolled back everything to 3.2 and all is well now.  And just fyi, I did do a full clean/rebuild several times when I had moved to 3.4.

             

            If noboody else is having this problem, does it sound like maybe I had a bum 3.4 install?  Maybe I should re-download and see if there were any special install instructions that I missed?

            • 3. Re: Embedding a list or datagrid within a datagrid - "A term is undefined and has no properties."
              vialisk

              Hi!

              We have confronted with similar problem. In our case, problem was solved when we removed access to 'data' property of dataGrid.

              old code with error:

                          <mx:DataGrid
                          id="customersGrid"
                          dataProvider="{model.customers}"

                          data="{model.customers}"
                          editable="false"
                          width="90%" height="500"

                          >

              Fixed code:

                          <mx:DataGrid
                          id="customersGrid"
                          dataProvider="{model.customers}"
                          editable="false"
                          width="90%" height="500"
                          >

               

              Probably you have similar problem..