2 Replies Latest reply on Jul 6, 2008 8:00 AM by |>AoA<|_killa

    Can't figure out why this object = null

    |>AoA<|_killa Level 1
      I have a component which is used as an itemrenderer(in a datagrid). Inside the checkIfEditable() function it can't seem to find "img". It says it's null. I've got no clue why it would do that? If I look at the this.img variable during debugging it also says null.
        • 1. Re: Can't figure out why this object = null
          Gregory Lafrance Level 6
          You may wish to do some tests to ensure img is in a state that allows it to be used in the checkIfEditable function.
          • 2. Can't figure out why this object = null
            |>AoA<|_killa Level 1
            I fixed it by removing the HBox from the itemrenderer's component and doing like this:

            <mx:DataGridColumn headerText="" dataField="Open">
            <mx:itemRenderer>
            <mx:Component>
            <mx:HBox horizontalAlign="center" width="18">
            <local:OpenKastRenderer data="{data}" isEditable="{isEditable}"/>
            </mx:HBox>
            </mx:Component>
            </mx:itemRenderer>
            </mx:DataGridColumn>

            Altough now i get another error: Access of undefined property isEditable.(it's talking about {isEditable})
            I don't get why it says that, isEditable is defined as

            [Bindable]
            public var isEditable:int = new int();

            outside of any function and it's set by another component.

            EDIT: nevermind, i've made it static