troubleshooting Question

Popup Window not executing creationComplete="initApp()"

Avatar of sfletcher1959
sfletcher1959Flag for United States of America asked on
Apache Flex
11 Comments1 Solution1517 ViewsLast Modified:
I have a popup window that only executes creationComplete="initApp()" the first time the popup is called. When the popup is closed and opened again the creationComplete="initApp()" doesn't run again.

I need to force "initApp()" to run each time the popup is opened in order to get data via an HTTPService.

Thanks!


<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
	 dropShadowEnabled="true" shadowDistance="10" 
	 borderStyle="solid" width="540" height="100%"
	 creationComplete="initApp()" layout="vertical" title="Chart Filters">
	
	<!--
		PROGRAM NAME ViewFilters
			Purpose: Called from the ChartDesigner Form.  Allows Adding / Editing of Filters
	-->
 
   <mx:Script>
        <![CDATA[
        	import mx.rpc.http.HTTPService;
        	import mx.managers.PopUpManager;       	
        	import mx.controls.Alert;
            import mx.rpc.events.ResultEvent;
            import util.ModelLocator;
            
            [Bindable]
            private var dataCollection2:XMLList;
            
            [Bindable]
			public var model:ModelLocator = ModelLocator.getInstance();
			        
  			public function initApp():void
  						{
    					getChartFiltersService.send()  //get the data now  						
  						}          
							
			 private function getResult(event:ResultEvent):void
			 			{
			 			var result:XML = event.result as XML;	
                        dataCollection2 = result..filter as XMLList;
                        updateGrid();
    					}
    					
			 public function updateGrid():void
			 			{
			  				ta3.text = dgFilters.dataProvider.getItemAt(0).fvalue;
						}
						
			private function handleCancel() : void {			
			mx.managers.PopUpManager.removePopUp(this);
		}
  		       					
                ]]>
    </mx:Script>
    
 
    <mx:HTTPService id="getChartFiltersService"
		url="http://localhost/Magic94Scripts/mgrqispi94.dll"
		method="POST"
		useProxy="false"
		resultFormat="e4x"
		result="getResult(event)">
	<mx:request>
		<appname>Web_Dev_Procurement</appname> 
		<prgname>getFilters</prgname>
		<arguments>param1,param2</arguments>
		<param1>{model.currentChartId}</param1>
	</mx:request>
	</mx:HTTPService>
	
		
		<mx:DataGrid id="dgFilters"
      	dataProvider="{dataCollection2}" width="100%"> 
            <mx:columns>            
            	<mx:DataGridColumn dataField="ffield" headerText="Field" width="60" />
            	<mx:DataGridColumn dataField="ftype" headerText="Filter Type" width="40" />            
        </mx:columns>
         </mx:DataGrid>
                           
         <mx:TextArea id="ta3" text="{dgFilters.selectedItem.fvalue}"  editable="false" width="100%" height="88" />     
		 <mx:TextArea text="{model.currentChartId}"/>
         <mx:ControlBar id="controlbar1" horizontalAlign="right" verticalAlign="bottom">
			<mx:Button id="searchButton" label="Cancel" click="handleCancel()"/>    
              
		</mx:ControlBar>
 
</mx:Panel>
ASKER CERTIFIED SOLUTION
zzynx
Sr. Software engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros