The namespace should be the same for the child tags. Try this:
 
<myComp:BetterDataGrid>
     <myComp:columns>
            <myComp:DataGridColumn headerText="Song Name" dataField="label"/>
            <myComp:DataGridColumn headerText="Artist" dataField="label"/>
    </myComp:columns>
</myComp:BetterDataGrid>

Stephen

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hank williams
Sent: Thursday, July 06, 2006 12:07 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] How to properly subclass a component using mxml

Nope there are no children.

Also, the specific error message is "could not resolve <mx:columns> to a component implementation."
It provides the same error message when trying to add a dataprovider too.

Hank

On 7/6/06, Tobias Patton <[EMAIL PROTECTED]> wrote:

This is just a shot in the dark:

 

Does your subclass of DataGrid have any children defined? I've never come across this myself, but I've read in various places that if a component has children in its definition, it's not possible to add children when instantiating it.

 

Tobias.

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of hank williams
Sent: Thursday, July 06, 2006 7:50 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to properly subclass a component using mxml

 

I want to create a subclass of DataGrid. So far what I have done is to create a new MXML component that is based on DataGrid.

The problem is that if I try to use the new component as if it was a dataGrid, certain things dont work. For example:

<myComp:BetterDataGrid>
     <mx:columns>
            <mx:DataGridColumn headerText="Song Name" dataField="label"/>
            <mx:DataGridColumn headerText="Artist" dataField="label"/>
    </mx:columns>
</myComp:BetterDataGrid>

in the above example, it doesnt like me using the columns construct to define the columns. In order to define columns in this way I need to put then in the actual BetterDataGrid component as opposed to in this instance. This makes it doggone hard to use BetterDataGrid as a generic "better dataGrid" since I cannot define its behavior on an instance by instance basis.

I am sure what I am doing wrong here is simple, but I dont know what.

Any insight appreciated.

Hank


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to