0

私は、かなりのフィールド検証を含むアプリケーションに取り組んでいます。検証はうまく機能し、検証メッセージのポップアップが以前に表示されていたことを 1000000% 確信しています。今、私はかなりの作業とリファクタリングを行いました。私が変更したことの 1 つは、ポップアップ/ダイアログを開く方法でした。これらを開始コンポーネントではなくアプリケーション全体に集中させるために、ダイアログを開く方法をリファクタリングしました。アラートのソースをベースとして使用しましたが、他の問題 (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;
}

検証ポップアップが表示されなくなった原因は何ですか? どこを見ればいいですか?

クリス

4

1 に答える 1

0

わかりました...だから、私はこれを自分でもう一度考え出しました。でも、見つけるのに時間がかかったので、壁に頭をぶつけたかもしれません。

Spart フォームを使用すると、エラー メッセージを出力するために、FormItems と Forms 自体でエラー テキスト領域を定義できます。そのため、FormItem が ID「errorTextDisplay」のスキン パーツをポーズするとすぐに、エラー メッセージがそこに表示されます。そのような部分がなければ、古い通知が使用されることを期待していました...いや。

FormItem とそのスキンのコードをいじって約 2 ~ 3 時間後、「contentGroup」が、showErrorTip を false に設定することでエラー tooltyips を抑制する属性を明示的に定義していることに気付きました。スキンから「errorTextDisplay」を削除し、showErrorTip を true に変更するだけで、ポップアップがきれいに表示されました :-)

この投稿が同じ問題を抱えている人の助けになることを願っています。

于 2012-09-29T13:08:32.820 に答える