3 Replies Latest reply on Feb 15, 2008 2:34 AM by dani4j

    Pop up problem

    dany4j
      Hello,

      I'm writing a code and when I insert the pop up function it gives me errors on other lines

      the pop up function is (dataSystem is my component which I want to popup - dataSystem.mxml):
      quote:


      private function tst():void {
      ________logonWindow = PopUpManager.createPopUp(this,dataSystem,false);
      ________PopUpManager.centerPopUp(logonWindow);
      }


      and the errors appear on the following lines (I give you the line numbers only where the errors appear)

      quote:


      private function getUsersList(event:ResultEvent):void {
      38______usrList=uList.lastResult.users.user;
      }
      private function chState(event:MouseEvent):void {
      ________var status:Boolean = true;
      43______teste.text = "Test";
      }
      private function editedValue(event:DataGridEvent):void {
      ________var txtIn:* = event.currentTarget.itemEditorInstance;
      47______idu = usersList.dataProvider.getItemAt(usersList.selectedIndex).id
      ________cn = event.dataField;
      ________nd = txtIn.text;
      50______st = usersList.dataProvider.getItemAt(usersList.selectedIndex).stare;
      51______teste.text = "ID: "+idu+" is "+st;
      // updateUserList.send();
      }


      If I remove these 2 lines from tst() it's compiling with no errors
      quote:


      logonWindow = PopUpManager.createPopUp(this,dataSystem,false);
      PopUpManager.centerPopUp(logonWindow);



      The errors are:
      quote:


      2___1120: Access of undefined property uList.______functions.as___Sysrom/files/as___line 39
      2___1120: Access of undefined property teste.______functions.as___Sysrom/files/as___line 43
      2___1120: Access of undefined property usersList.___functions.as___Sysrom/files/as___line 47
      2___1120: Access of undefined property usersList.___functions.as___Sysrom/files/as___line 47
      2___1120: Access of undefined property usersList.___functions.as___Sysrom/files/as___line 50
      2___1120: Access of undefined property usersList.___functions.as___Sysrom/files/as___line 50
      2___1120: Access of undefined property teste.______functions.as___Sysrom/files/as___line 51



      P.S. Those properties exists and they work if I remove those 2 lines.

      I hope I made myself clear. Thank You
        • 1. Re: Pop up problem
          Gregory Lafrance Level 6
          I see some uses of the "private" access modifier above. Just a thought, are those properties private, or are their classes somehow such that the properties are not in scope? Namespaces? Just trying to help.
          • 2. Re: Pop up problem
            dazweeja
            Are those errors in dataSystem.mxml? Are those properties (userList, etc) declared in dataSystem.mxml or the component that is calling the PopUp? If it's the latter, you have to use parentDocument to access them and they must have be declared public in the parent component, eg. in dataSystem.mxml you would use parentDocument.userList.
            • 3. Re: Pop up problem
              dani4j
              Thank you for reply .... I didn't receive mail about new posts that's why I reply so late.

              I'll paste the code to you:

              main.mxml
              quote:


              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientColors="[#cceeff, #cceeff]" creationComplete="uList.send()">
              <mx:Script source="files/as/functions.as"/>
              <mx:HTTPService id="updateUserList" method="POST" useProxy="false" url=" http://localhost/administrator/users.php?action=update">
              <mx:request xmlns="">
              <id>{idu}</id>
              <item>{cn}</item>
              <value>{nd}</value>
              </mx:request>
              </mx:HTTPService>
              <mx:HTTPService id="uList" url=" http://localhost/administrator/users.php" result="getUsersList(event)"/>
              <mx:Image source="files/images/sysrom.gif" autoLoad="true" scaleContent="false" width="261" top="0" right="0"/>
              <mx:TabNavigator x="0" y="145" width="100%" height="70%" fillColors="[#E1F2E1, #E1F2E1]">
              <mx:Canvas label="Utilizatori" width="100%" height="100%">
              <mx:DataGrid id="usersList" x="0" y="0" width="100%" height="100%" dataProvider="{usrList}" editable="true" allowMultipleSelection="false" itemEditEnd="{editedValue(event)}">
              <mx:columns>
              <mx:DataGridColumn headerText="Id" dataField="id" width="30" editable="false"/>
              <mx:DataGridColumn headerText="Numele" dataField="numele"/>
              <mx:DataGridColumn headerText="Prenumele" dataField="prenumele"/>
              <mx:DataGridColumn headerText="E-mail" dataField="email"/>
              <mx:DataGridColumn id="isActive" headerText="Active" dataField="stare" width="50" rendererIsEditor="true" editorDataField="result" itemRenderer="mx.controls.CheckBox" />
              </mx:columns>
              </mx:DataGrid>
              </mx:Canvas>
              </mx:TabNavigator>
              <mx:Button x="10" y="110" label="Adaugă" enabled="true" click="popUpSystems()"/>
              <mx:HRule x="0" y="140" width="100%"/>
              <mx:TextInput y="110" right="77"/>
              <mx:Button y="110" label="Caută" right="10"/>
              <mx:Label y="140" text="" id="teste" right="10"/>
              <mx:Button x="88" y="110" label="Button"/>
              </mx:Application>



              functions.as
              quote:


              import flash.display.DisplayObject;
              import flash.events.MouseEvent;

              import mx.collections.ArrayCollection;
              import mx.containers.TitleWindow;
              import mx.controls.CheckBox;
              import mx.controls.TextInput;
              import mx.core.IFlexDisplayObject;
              import mx.events.CloseEvent;
              import mx.events.CollectionEvent;
              import mx.events.DataGridEvent;
              import mx.managers.PopUpManager;
              import mx.rpc.events.ResultEvent;


              [Bindable]
              private var usrList:ArrayCollection;
              [Bindable]
              private var idu:Number;
              [Bindable]
              private var cn:String;
              [Bindable]
              private var nd:String;
              [Bindable]
              private var st:String;

              private function getUsersList(event:ResultEvent):void {
              usrList=uList.lastResult.users.user;
              }
              private function chState(event:MouseEvent):void {
              var status:Boolean = true;
              teste.text = "Test";
              }
              private function editedValue(event:DataGridEvent):void {
              var txtIn:* = event.currentTarget.itemEditorInstance;
              idu = usersList.dataProvider.getItemAt(usersList.selectedIndex).id
              cn = event.dataField;
              nd = txtIn.text;
              st = usersList.dataProvider.getItemAt(usersList.selectedIndex).stare;
              teste.text = "ID: "+idu+" is "+st;
              // updateUserList.send();
              }
              private function popUpSystems():void {
              var winCompmponent:IFlexDisplayObject = PopUpManager.createPopUp(this, sistemePopUp,true);
              }



              So if I remove:
              var winCompmponent:IFlexDisplayObject = PopUpManager.createPopUp(this, sistemePopUp,true);
              everiything is compiled OK.

              I hope I made myself clear and you can help me.

              Thank You.

              P.S. sistemePopUp (sistemePopUp.mxml - component) is TitleWindow