Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6555805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:51:53+00:00 2026-05-25T12:51:53+00:00

I created a custom MXML component, TurboContent, that extends the NavigatorContent class: <s:NavigatorContent xmlns:fx=http://ns.adobe.com/mxml/2009

  • 0

I created a custom MXML component, TurboContent, that extends the NavigatorContent class:

<s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx">

<fx:Metadata>
[DefaultProperty("mxmlContentFactory")]
</Fx:Metadata>

<s:Group id="midWrapper">
    <s:Button id="btnAdd" />
</s:Group>
<s:Group id="rightWrapper" >
    <s:DataGrid id="dgdSelect" >
        <s:columns>
            <s:ArrayList>
                <s:GridColumn headerText="Yo"></s:GridColumn>
            </s:ArrayList>
        </s:columns>
    </s:DataGrid>
    <s:Button id="btnRemove" />
    <s:Button id="btnClear" />
</s:Group>
</s:NavigatorContent>

I am trying to extend that custom component but when I add display elements to the second extended componet they elements are never seen. For instance: (The first custom component is in the comp package)

<comp:TurboContent xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:comp="comp.*">

<s:Button id="myButton"/>

</comp:TurboContent>

In this case, the ‘myButton’ component never shows up, but all the elements of the base component do (3 buttons and a datagrid).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:51:54+00:00Added an answer on May 25, 2026 at 12:51 pm

    From what I can tell, the pattern of defining a component directly in MXML (as you referenced was done in the FIAW series) disallows the ability to then visually insert children in the container’s display list. One of the problems is that the mxmlContent (which normally a skin would control) is statically defined in the component and it doesn’t seem like one can use contentGroup inside the MXML component directly.

    For better control, and what I consider a more strict implementation of the MVC pattern (which Flex 4, as a framework, implements), try separating your visual layout out into an MXML skin, and defining the component in AS3.

    From what little I see of your component, I can’t really make a judgment as to what properties of the component you want to expose to the container that will instantiate it. I’ll at least give an example here of how one can pass info from the component to the skin.

    I apologize for the MX components, but I only have Flex 4.1, and I wanted to make sure the program compiled fine. It shouldn’t be too hard for you to swap in the spark versions.

    Example Component (TurboContentAS.as)

    package components {
    
      import mx.controls.DataGrid;
      import spark.components.NavigatorContent;
    
      public class TurboContentAS extends NavigatorContent {
    
        public function TurboContentAS() {
          super();
        }
    
        // Skin Parts that constitute the necessary parts of the component
        [SkinPart(required="true")]
        public var dgdSelect:DataGrid;  //just an example
    
        // property you want to expose to the instantiating object
        [Bindable]
        public var firstColumnHeader:String = "default header";
    
      }
    }
    

    Example Skin (TurboContentSkin.mxml)

    <?xml version="1.0" encoding="utf-8"?>
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx"
            alpha.disabled="0.5" >
    
        <fx:Metadata>[HostComponent("components.TurboContentAS")]</fx:Metadata>
    
        <s:states>
            <s:State name="normal" />
            <s:State name="disabled" />
        </s:states>
    
        <!-- this is where the children that you add later go-->
        <s:Group id="contentGroup" left="0" right="0" top="100" bottom="0" minWidth="0" minHeight="0">
            <s:layout>
                <s:BasicLayout/>
            </s:layout>
        </s:Group>
        <s:Group id="midWrapper">
            <s:Button id="btnAdd" label="Add" />
        </s:Group>
        <s:Group id="rightWrapper" left="200">
            <s:layout>
                <s:VerticalLayout/>
            </s:layout>
            <mx:DataGrid id="dgdSelect">
                <mx:columns>
                    <fx:Array>
          <!-- This will bind to the publicly exposed property in the component definition -->
                        <mx:DataGridColumn  headerText="{hostComponent.firstColumnHeader}"/>
                    </fx:Array>
                </mx:columns>
            </mx:DataGrid>
            <s:Button id="btnRemove" label="Remove"/>
            <s:Button id="btnClear" label="Clear"/>
        </s:Group>
    </s:Skin>
    

    Example Instantiation

    <components:TurboContentAS skinClass="skins.TurboContentSkin" firstColumnHeader="myHeader">
            <s:Button label="myButton"/>
        </components:TurboContentAS>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a custom button skin: <?xml version=1.0 encoding=utf-8?> <s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx minWidth=65
I have created a Popup that is custom component extends Canvas i want the
So I'm using a custom auto suggest component that I found online at http://hillelcoren.com/flex-autocomplete/
I've created custom dialog (from xml file), like below: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical
I created a custom button component that accepts an array as a property. I
i created a Custom Trace Liastener inside a class library : namespace SendMailTraceListener {
O.K. Here's the situation... I have a custom mxml component that contains a couple
I have created custom aplication resource: class Custom_Entitymanager extends Zend_Application_Resource_ResourceAbstract{ //... public function init
I've created a custom component in Flex, and I've created it from the main
When I create a custom component, I define a property which is array that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.