Can someone tell me why this code keeps throwing an error? It says:

TypeError: Error #1009: null has no properties.
    at mx.containers.utilityClasses::CanvasLayout/measure()
    at mx.core::Application/mx.core:Application::measure()
    at mx.core::UIComponent/::measureSizes()
    at mx.core::UIComponent/validateSize()
    at mx.core::Container/validateSize()
    at mx.managers::LayoutManager/validateSize()
    at mx.managers::LayoutManager/::doPhasedInstantiation()
    at mx.core::UIComponent/::callLaterDispatcher2 ()
    at mx.core::UIComponent/::callLaterDispatcher()

In fact, it happens only on the first time i show the window, otherwise it works fine.
I´m experiencing such errors in other places too, such as on another window with an accordeon, and many input field on its children, but like this problem above, when i try to set the value of those fields only those in the first container of the accordeon are writable. The rest, only if i close the window and open it again. How to deal with this?
Thanks in advance!



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml " xmlns="*" layout="absolute">
<mx:Script><![CDATA[


        import mx.managers.PopUpManager;


        private function showWindow(winObj:TitleWindow):void
        {
            PopUpManager.addPopUp(winObj,this , true);
            PopUpManager.centerPopUp(winObj);
            winObj.visible = true;
        }

        private function closeWin(winObj:TitleWindow):void
        {
             PopUpManager.removePopUp(winObj);           
            winObj.visible = false;
        }



        private function formBanco():void
        {


            xBancoCodigo.text=' ';
            xBancoNome.text='';
            xBancoObs.text='';                                    
            showWindow(winBanco);                        
        }

]]>
    </mx:Script>


    <mx:Accordion width="150" y="50" left="22" height="150" historyManagementEnabled="false">
        <mx:Canvas label="Bancos" width="100%" height="80">
            <mx:LinkButton x="10" y="10" label="Novo banco" click="formBanco();"/>
        </mx:Canvas>
    </mx:Accordion>

    <mx:TitleWindow showCloseButton="true" close="closeWin(winBanco);" creationPolicy="auto" id="winBanco" visible="false" x="201" y="125" layout="absolute" width="359" height="261" title="Novo banco">
        <mx:Label x="10" y="10" text="Código:"/>
        <mx:TextInput id="xBancoCodigo" x="75" y="8" width="225"/>
        <mx:Label x="10" y="40" text="Nome:"/>
        <mx:TextInput id="xBancoNome" x="75" y="38" width="225"/>
        <mx:Label x="10" y="68" text="Descrição"/>
        <mx:TextArea x="75" y="68" width="225" height="88" id="xBancoObs"/>
        <mx:Label x="54" y="10" text="*" color="#ff0000"/>
        <mx:Label x="81" y="164" text="* Campos obrigatórios" color="#ff0000" id="lblObFieldsBanco"/>
        <mx:Label x="48" y="40" text="*" color="#ff0000"/>
        <mx:Button x="185" y="189" label="Enviar" id="subBtnBanco" enabled="false"/>
        <mx:Button x="254" y="189" label="Cancelar" id="closeBtnBanco" click="closeWin(winBanco);"/>    
    </mx:TitleWindow>
    

</mx:Application>



--
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