模块和面板问题 [英] Modules and Panels issue

查看:202
本文介绍了模块和面板问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题。

在我的应用我有几个模块,每个人都有组件CollapsableTitleWindow(扩展面板)。打开窗口后它被添加到该容器是在所述主应用程序(CollapsableTitleWindowContainer)。在这些窗口中,您可以(等)打开另一扇窗。

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] (...)

表示主要的应用有对象面板

请帮忙。

P.S。我发现 http://www.nabble.com类似的问题/Flex-Module-issue-with-Panel-td20168053.html

增加: 我extendes Panel类,做这样的事情:

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 After

您可以看到,它洛斯样式声明。

You can see that it loos style declaration.

推荐答案

我找到了一个解决方案,但它是坏的初步实践:

I found a solution but it is bad pratice:

我加在我的主要应用

public function getProductWindow():ProductWindow {
    return new ProductWindow();
}

和变化的模块中:

var productWindow:ProductWindow = new ProductWindow();

var productWindow:ProductWindow = Application.application.getProductWindow();

如果任何人有一个更好的解决方案?

If anyone have a better solution ?

这篇关于模块和面板问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆