2 Replies Latest reply on Oct 27, 2009 1:09 AM by ak88

    Flex Module issue with Panel

    ak88

      Hello everyone. I have the following problem.

      In my application I have several modules and each of them have components CollapsableTitleWindow (extends Panel). After opening the window it is added to the container which is in the main application (CollapsableTitleWindowContainer). In these windows you can open another window (and so on).

      Now, what is the problem. When I change (reload) any module and I want to open a new window (sub window) with the already loaded window I get this error:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx
      .containers::Panel/layoutChrome()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\Panel.as:1405]
      at com
      ::CollapsableTitleWindow/layoutChrome()[D:\Flex 3 Workspace\WesobCrm\src\com\CollapsableTitleWindow.as:216]
      at mx
      .core::Container/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2867] (...)

       

      Indicates that the main applications have object Panel

       

      Please help.

       

      P.S. I found a similar problem on http://www.nabble.com/Flex-Module-issue-with-Panel-td20168053.html

       

      ADDED: I extendes the Panel class and do something like that:

      override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void
             
      {
                     
      use namespace mx_internal;
                     
      if(!(mx_internal::titleBarBackground is TitleBackground)) {
                              mx_internal
      ::titleBarBackground = new TitleBackground();
                     
      }
                     
      super.layoutChrome(unscaledWidth, unscaledHeight);                     
             
      }

      But now i had something like that: Before alt text After alt text

      You can see that it loos style declaration.H