views:

83

answers:

1

Hi, when extending a flex component and trying to use it, I get a RTE. I.e. I am extending a DataCanvas and am using it like this:

<MyComponent dataProvider="{dataProvider}" width="100%" height="100%" x="0" y="0" id="dc" verticalCenter="0" horizontalCenter="0" />

Has anyone seen this? How can I get around it? Thanks!

Error: ConstraintColumn '[object' not found.
at mx.containers.utilityClasses::CanvasLayout/applyAnchorStylesDuringUpdateDisplayList()[E:\dev\beta1\frameworks\projects\framework\src\mx\containers\utilityClasses\CanvasLayout.as:544]
at mx.containers.utilityClasses::CanvasLayout/updateDisplayList()[E:\dev\beta1\frameworks\projects\framework\src\mx\containers\utilityClasses\CanvasLayout.as:287]
at mx.containers::Canvas/updateDisplayList()[E:\dev\beta1\frameworks\projects\framework\src\mx\containers\Canvas.as:400]
at mx.core::UIComponent/validateDisplayList()[E:\dev\beta1\frameworks\projects\framework\src\mx\core\UIComponent.as:7691]
at mx.core::Container/validateDisplayList()[E:\dev\beta1\frameworks\projects\framework\src\mx\core\Container.as:3208]
at mx.managers::LayoutManager/validateDisplayList()[E:\dev\beta1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:663]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\beta1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\beta1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1067]
+1  A: 

Could be a number of things, might be good to post the source code up so we can have a look at it.

At first glance it might be the fact that flex cannot find your component because you haven't given it the correct path.

The usual structure for declaring mxml component is to qualify them with a namespace so the compiler knows where to look. for example for standard flex component you prefix 'mx' to the front of the components tag:

<mx:label text='boo'/>

Remember mxml is a subset of xml so all the same rules apply. So i would first try adding a namespace declaration to your root tag and then qualifying your component with that namespace. the namespace should point to the folder you have the components source file in i.e.

<Application xmlns:customcomponents="myComponents.*" >

Then qualify the component like so:

   <customcomponents:MyComponent dataProvider="{dataProvider}" width="100%" 
height="100%" x="0" y="0" id="dc" verticalCenter="0" horizontalCenter="0" />

A handle tip is if you press control + spacebar and cannot find your component declare then flex cannot see your component, its the same with classes they have to be imported to be used, this is just a form of that.

Hope this helps.

Jon

Jon