Instead of using creationComplete, you might want to wait until you get a 
resultEvent from the server.


On 3/29/10 1:12 PM, "Scott" <[email protected]> wrote:






It’s throwing because the cbGroupSelect.selectedItem.pkGroupID doesn’t exist 
when it’s trying to call it the list_update function…  The combobox 
cbGroupSelect pulls its data from the provider first which gives the index 
fields for the list object.  I’m doing creation_complete on the list object, 
but the object is created before the data provider for the combobox has filled 
its data.

Here’s the dump:

TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
      at 
Config/list_creationCompleteHandler()[X:\PackRat\www\src\Config.mxml:25]
      at 
Config/__lstItemList_creationComplete()[X:\PackRat\www\src\Config.mxml:98]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at 
mx.core::UIComponent/dispatchEvent()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:11749]
      at mx.core::UIComponent/set 
initialized()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:1525]
      at 
mx.managers::LayoutManager/validateClient()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:988]
      at 
mx.core::UIComponent/validateNow()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:7249]
      at 
mx.core::UIComponent/creationCompleteHandler()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:10846]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at 
mx.core::UIComponent/dispatchEvent()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:11749]
      at mx.core::UIComponent/set 
initialized()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:1525]
      at 
mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:759]
      at 
mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1069]


________________________________

From: [email protected] [mailto:[email protected]] On Behalf 
Of Alex Harui
Sent: Monday, March 29, 2010 2:47 PM
To: [email protected]
Subject: Re: [flexcoders] Dataprovider and events



Post the entire stacktrace so we can see why it throws.


On 3/29/10 11:33 AM, "Scott" <[email protected]> wrote:






I know I've ran into this before but for some reason my memory isn't
kicking in.

I've got a listbox that depends on a combobox to load before it fires
its dataprovider.  Without having the combobox loaded, the data provider
for the listbox is null and it throws an error: #1009: Cannot access a
property or method of a null object reference.

I know why it's happening but I can't seem to figure out a workaround...
Any ideas?






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to