troubleshooting Question

DisplayObject must be a child of the caller

Avatar of thebellman
thebellmanFlag for United States of America asked on
Apache Flex
5 Comments2 Solutions776 ViewsLast Modified:
I can't seem to figure why I'm getting this error:

The supplied DisplayObject must be a child of the caller.

I'm trying to populate a ComboBox with a itemRenderer.  I'm guessing that the parent display object is loading before the child is ready, but I'm not sure how to fix?

Any ideas?

Thanks,

John
<?xml version="1.0" encoding="utf-8"?>
<mx:Application 	xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"		>
<mx:Script>
	<![CDATA[
import mx.events.DragEvent;
import mx.managers.DragManager;
private function dragEnterRows(event:DragEvent):void
    	{    		
    		DragManager.acceptDragDrop(rowsBox);
    	}
]]>
</mx:Script>	
	<mx:Canvas width="749" height="232" x="53" y="14">
		<mx:ComboBox id="comboBox" dataProvider="{[' ']}"
		itemRenderer="ComboItemRenderer"  width="190" x="19" y="12">
		
		</mx:ComboBox>
		<mx:VBox id="rowsBox" height="174" width="259" dragEnter="dragEnterRows(event)" 
				dragDrop="" dragOver=""
				 toolTip="Drop Row Fields Here"
				borderColor="0xFFFFFF" borderStyle="solid" x="453" y="20"/>
	</mx:Canvas>
</mx:Application>


<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/09/25/creating-a-custom-combobox-item-renderer-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:fc="comps.*"        layout="vertical"        verticalAlign="top"        backgroundColor="white">
<mx:Script>
		<![CDATA[			import mx.collections.XMLListCollection;					]]>
	</mx:Script>
<mx:VBox width="100" height="100%">
	<!--		<fc:DimensionList dataProvider="{['MarketValue', 'Volume', 'RiskCapital_1Yr']}" height="100%" width="100%" id="m1"  color= "0x000000" />-->
			<mx:Label text="hello" />
</mx:VBox>
</mx:Application>
ASKER CERTIFIED SOLUTION
thebellman

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros