문제

잘못된 플렉스 메소드를 사용하고 있다는 것을 깨달았 기 때문에 내 질문을 재구성해야했습니다. 그러나 여전히 비슷한 문제가 발생합니다.

        private function passForm():void {


            PopUpManager.addPopUp(passTitleWindow, this, true);
            PopUpManager.centerPopUp(passTitleWindow);


        } 

                            <s:Button includeIn="Detail" x="10" y="329" 
                                  id= "btn1"
                                  label="Pass"
                                  click="passForm()" 
                                  visible="{hasScreen}" />

클릭하면 팝업이 표시되지 않습니다.

도움이 되었습니까?

해결책

당신은 그것에 따라 항목을 인스턴스화 할 수 없습니다 id. 타이틀 창을 다른 클래스로 만들고 인스턴스화하십시오.

PasstitleWindow.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    title="Pass"
    layout="vertical"
    width="480"
    height="240"
    titleStyleName="titleText"
    backgroundColor="white"
    backgroundAlpha="1.0"
    borderColor="white"
    borderAlpha="1.0"
    cornerRadius="0"
    showCloseButton="true"
    implements="mx.core.IDataRenderer">

    <fx:Script>
        <![CDATA[

            private var _data:Object;
            [Bindable(event="dataChange")]
            /**
             *  implementing mx.core.IDataRenderer.
             *  Set this value from outside
             */
            public function get data():Object
            {
                return _data;
            }

            /**
             *  @private
             */
            public function set data(value:Object):void
            {
                if (_data == value) 
                    return;
                _data = value;
                dispatchEvent(new Event("dataChange"));
            }
        ]]>
    </fx:Script>

    <mx:Text text="Please fill out the following criteria and then click continue."
        width="100%"
        styleName="headingText"/>

    <mx:Form x="-12" y="150" id="passView">

        <mx:FormItem label="Age" >
            <s:TextInput id="ageTextInput" "@{data.age}"/>
        </mx:FormItem>
        <mx:FormItem label="Grade" >
            <s:TextInput id="gradeTextInput"/>
        </mx:FormItem>

    </mx:Form>

</mx:TitleWindow>

SampleApp.mxml

<?xml version="1.0" encoding="utf-8"?>
<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    creationComplete="creationCompleteHandler()">

    <fx:Script>
        <![CDATA[

            import mx.managers.PopUpManager;

            protected var passWindow:PassTitleWindow = new PassTitleWindow;

            protected function creationCompleteHandler():void
            {
                createForm();
            }

            protected function createForm():void
            {
                passWindow = PopUpManager.createPopUp(this, PassTitleWindow, true) as PassTitleWindow;
                passWindow.data = studentGrid.selectedItem;
                PopUpManager.centerPopUp(passWindow);
            }
        ]]>
    </fx:Script>

</s:Application>

도움이되기를 바랍니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top