弹出对话框中不再显示Flex验证弹出窗口?

时间:2012-09-26 11:13:18

标签: flex popup validation

我正在开发一个具有相当多字段验证功能的应用程序。验证效果很好,我1000000%肯定验证消息弹出窗口早先出现。现在我做了很多工作和重构。我改变的一件事是我打开Popups / Dialog的方式。为了让这些以整个应用程序为中心而不是开放组件,我重构了我打开对话框的方式。我使用Alert的来源作为基础,但是因为我遇到其他问题(Focus Manager等)而扩展了它(我只是提到这一点,因为我假设我丢失的弹出窗口与此相关)。

以下是负责在我的应用程序中打开弹出窗口的代码:

    public function show(realParent:Sprite,
                     displayParent:Sprite = null,
                     closeHandler:Function = null,
                     moduleFactory:IFlexModuleFactory = null):Dialog {

    // Get the parent ...
    // If none is set, use the top-level-application.
    if (!displayParent) {
        var sm:ISystemManager = ISystemManager(FlexGlobals.topLevelApplication.systemManager);
        // no types so no dependencies
        var mp:Object = sm.getImplementation("mx.managers.IMarshallPlanSystemManager");
        if (mp && mp.useSWFBridge())
            displayParent = Sprite(sm.getSandboxRoot());
        else
            displayParent = Sprite(FlexGlobals.topLevelApplication);
    }

    // Register for close-events, making sure the pop-up is closed.
    if (closeHandler != null) {
        this.addEventListener(CloseEvent.CLOSE, closeHandler);
    }

    // Setting a module factory allows the correct embedded font to be found.
    if (moduleFactory) {
        this.moduleFactory = moduleFactory;
    } else if (realParent is IFlexModule) {
        this.moduleFactory = IFlexModule(realParent).moduleFactory;
    } else {
        if (realParent is IFlexModuleFactory) {
            this.moduleFactory = IFlexModuleFactory(realParent);
        } else {
            this.moduleFactory = FlexGlobals.topLevelApplication.moduleFactory;
        }

        // also set document if parent isn't a UIComponent
        if (!parent is UIComponent) {
            this.document = FlexGlobals.topLevelApplication.document;
        }
    }

    // Make the dialog center itself relative to the parent.
    PopUpManager.addPopUp(this, displayParent, true);
    PopUpManager.centerPopUp(this);

    return this;
}

什么可能导致验证弹出窗口不再显示?我应该在哪里看?

克里斯

1 个答案:

答案 0 :(得分:0)

好的......所以我再次把它弄清楚了。尽管如此,我仍然可以把头撞到墙上,花了很长时间才找到它。

如果我使用Spart表单,FormItems和Forms本身可以定义错误文本区域以输出错误消息。因此,只要FormItem带有id为“errorTextDisplay”的外观部件,就会出现错误消息。我现在期待如果没有这样的部分,旧的通知将被使用......不。

在使用FormItem的代码和它的皮肤大约2-3个小时后,我注意到“contentGroup”通过将showErrorTip设置为false显式定义了一个属性来抑制错误工具类型。只需从皮肤中删除“errorTextDisplay”并将showErrorTip更改为true,就可以很好地显示我的弹出窗口: - )

希望这篇文章可以帮助有同样问题的人。

相关问题