1

Main File:

<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:local="*"
                   xmlns:models="models.*"
                   xmlns:js="library://ns.apache.org/royale/basic"  xmlns:j="library://ns.apache.org/royale/jewel">
    <fx:Script>
        <![CDATA[
            import models.ProductsModel;

            import org.apache.royale.html.DataGrid;

            import products.Product;
            import org.apache.royale.collections.ArrayList;

        ]]>
    </fx:Script>

    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

    <js:initialView >
    <j:View>
    <j:beads>
        <js:ContainerDataBinding/>
    </j:beads>
    <js:model> 
        <models:ListsModel id="listModel" />
    </js:model>

                <j:DropDownList>
                    <j:beads>
                     <js:ConstantBinding
                            sourceID="listModel"
                            sourcePropertyName="ComponentList"
                            destinationPropertyName="dataProvider" />
                    </j:beads>
                </j:DropDownList>
    </j:View>
    </js:initialView>
</j:Application>

The debugging Error I am getting: this.view is undefined

This error points to the following function in the DropDownListController.js file:

org.apache.royale.jewel.beads.controllers.DropDownListController.prototype.selectedHandler = function(event) {
  this.model.selectedIndex = (event.index) >> 0;
  this.model.selectedItem = event.data;
  this.view.host.dispatchEvent(new org.apache.royale.events.Event(org.apache.royale.events.Event.CHANGE));
};

Any Idea as to why its throwing this Exception?

Bash
  • 23
  • 2

1 Answers1

1

Have you check that your listModel has a ComponentList property ?

Try this code, it is working on my side on sdk 0.9.4 and 0.9.6

<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:local="*"
                   xmlns:models="models.*"
                   xmlns:js="library://ns.apache.org/royale/basic"  xmlns:j="library://ns.apache.org/royale/jewel">
    <fx:Script>
        <![CDATA[
           // import models.ProductsModel;

            import org.apache.royale.html.DataGrid;

            //import products.Product;
            import org.apache.royale.collections.ArrayList;

        ]]>
    </fx:Script>

    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

    <js:initialView >
    <j:View>
    <j:beads>
        <js:ContainerDataBinding/>
    </j:beads>
                <j:DropDownList>
                    <j:dataProvider>
                        <js:ArrayList  source="[Iron Man, Hulk, Thor, Captain America, Hawkeye]" />
                    </j:dataProvider>
                </j:DropDownList>
    </j:View>
    </js:initialView>
</j:Application>
Fred
  • 399
  • 3
  • 12