4 Replies Latest reply on Sep 1, 2006 2:06 PM by awclemen

    error 1069 on use of DataGrid

    Level 1
      Hello Forum Folks,

      I have an Object that represents a row in database. This object is called com.sundt.pmdataVwCompanyBean. This is essentially an object that contains public variables that correspond to columns in the database. These are remote actionscript classes that map to Java objects. When I recieve an array of them from my RemoteObject call and set them to my dataGrid's dataprovider, I get an error:

      ReferenceError: Error #1069: Property label not found on com.sundt.pmdata.VwCompanyBean and there is no default value.
      at mx.controls.dataGridClasses::DataGridColumn/itemToDataTip()
      at mx.controls.dataGridClasses::DataGridItemRenderer/validateProperties()
      at mx.managers::LayoutManager/validateClient()[C:\dev\GMC\sdk\frameworks\mx\managers\LayoutM anager.as:780]
      at mx.controls::DataGrid/::setupRendererFromData()
      at mx.controls::DataGrid/mx.controls:DataGrid::commitProperties()
      at mx.core::UIComponent/validateProperties()[C:\dev\GMC\sdk\frameworks\mx\core\UIComponent.a s:5218]
      at mx.managers::LayoutManager/mx.managers:LayoutManager::validateProperties()[C:\dev\GMC\sdk \frameworks\mx\managers\LayoutManager.as:517]
      at mx.managers::LayoutManager/mx.managers:LayoutManager::doPhasedInstantiation()[C:\dev\GMC\ sdk\frameworks\mx\managers\LayoutManager.as:658]
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher2()[C:\dev\GMC\sdk\framework s\mx\core\UIComponent.as:7789]
      at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher()[C:\dev\GMC\sdk\frameworks \mx\core\UIComponent.as:7732]


      It seems to me, that this error tells me that the DataGridColumn is looking for a "label" property or variable for which it can retrieve information from. When I add the following line to my com.sundt.pmdata.VwCompanyBean class, I no longer get the error:
      public var label:String = "";

      Now, I'm not sure why the DataGrid is forcing the need of a label property for it's data objects. I can't find any documentation that states that objects in the datagirid should have this property.

      Also, I'm not using the dataTip function in the dataGrid or it's associated dataGridColumns. So I am kind of confused why this is. What forces the DataGrid to need such a property from it's objects?

      any help would be most appreciated.

      Thanks,
      Andy


        • 1. Re: error 1069 on use of DataGrid
          peterent Level 2
          On your DataGridColumns did you use the dataField property to name the field from your Object that should be presented in the columns? I believe the dataField defaults to 'label'.
          • 2. Re: error 1069 on use of DataGrid
            Level 1
            Yep, I do specify a dataField on each DataGridColumn... my code below:

            <mx:columns>
            <mx:Array>
            <mx:DataGridColumn dataField="companyId" width="0" resizable="false" />
            <mx:DataGridColumn headerText="JDE No" dataField="jdeId" width="50" resizable="true" />
            <mx:DataGridColumn headerText="Company Name" dataField="name" width="300" resizable="true" />
            <mx:DataGridColumn headerText="City" dataField="primaryCity" resizable="true" />
            <mx:DataGridColumn headerText="State" dataField="primaryState" width="50" resizable="true" />
            <mx:DataGridColumn headerText="Max Contract Amount" dataField="maxContractAmount" textAlign="right" width="150" labelFunction="formatContractAmount" resizable="true" />
            <mx:DataGridColumn headerText="SAM" dataField="samScore" textAlign="right" width="75" resizable="true" />
            </mx:Array>
            </mx:columns>


            Any other ideas?

            Appreciate the response, Peter!

            Thanks,
            Andy
            • 3. Re: error 1069 on use of DataGrid
              inlineblue Level 1
              The only way I got this to happen was if showDataTips was set to true. It looks like none of your columns have it set, so are you sure that your grid doesn't have it set?
              • 4. Re: error 1069 on use of DataGrid
                Level 1
                Yep, it wasn't set - since I never use dataTips.

                However, on a stranger note.... I have continued on with fixing other errors and now that I have come back to this one, it is gone. So, something I fixed somewhere else in the application took care of this problem. I have changed so much code, that I'm not sure what it was though. I'm in the mist of a migration from 1.5 to 2.0 (truly nasty business) for our huge flex app.

                Sorry I don't have an answer... but if anyone runs into this again, my suggestion is to fix all the errors and see if this one still persists.

                --Andy