GP works correclty but results are not displayed until I reload the page

969
1
Jump to solution
02-03-2014 09:29 AM
ionarawilson1
Occasional Contributor III
I have a gp that gets calculated correctly but I only see the results if I reload the entire page. Is there a way to see the result without having the reload the entire page? thanks

      private function calculalteplanid():void     {      var  SelectingFeature:FeatureSet = new FeatureSet();   SelectingFeature.features = myFeatureLayerstewardship.selectedFeatures  SelectingFeature.fields = myFeatureLayerstewardship.layerDetails.fields      var features:ArrayCollection = ArrayCollection(myFeatureLayerstewardship.graphicProvider);   var featureSet:FeatureSet = new FeatureSet(features.source);    featureSet.fields = myFeatureLayerstewardship.layerDetails.fields    var params:Object  = {    "Selecting_Features": SelectingFeature,    "Stewardship": featureSet   }       var geoprocessTask:Geoprocessor = new Geoprocessor();   geoprocessTask.outSpatialReference = myMap.spatialReference;    geoprocessTask.url = "http://tfsgis-iisd01:6080/arcgis/rest/services/TwoParametersWithSelection2/GPServer/CalcFeaturesStewardshipOneParameterSelection";      geoprocessTask.submitJob(params, null, null);      geoprocessTask.addEventListener(GeoprocessorEvent.JOB_COMPLETE,jobCompleteHandler);      geoprocessTask.addEventListener(FaultEvent.FAULT, faultHandler2);    }    private function jobCompleteHandler(e:GeoprocessorEvent):void         {          Alert.show("Plan ID created");     myAttributeTablespatial.refresh()        myFeatureLayerstewardship.refresh()              }                private function faultHandler2(f:FaultEvent):void         {          Alert.show("Unexpected fault:\n" + f.toString());         }
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ionarawilson1
Occasional Contributor III
I made the layer and the table invisible, then visible again when completed

  private function calculalteplanid():void     {      var  SelectingFeature:FeatureSet = new FeatureSet();   SelectingFeature.features = myFeatureLayerstewardship.selectedFeatures  SelectingFeature.fields = myFeatureLayerstewardship.layerDetails.fields      var features:ArrayCollection = ArrayCollection(myFeatureLayerstewardship.graphicProvider);   var featureSet:FeatureSet = new FeatureSet(features.source);   // or  // var featureSet:FeatureSet = new FeatureSet(features.toArray())     featureSet.fields = myFeatureLayerstewardship.layerDetails.fields   CursorManager.setBusyCursor();   var params:Object  = {    "Selecting_Features": SelectingFeature,    "Stewardship": featureSet   }       var geoprocessTask:Geoprocessor = new Geoprocessor();   geoprocessTask.outSpatialReference = myMap.spatialReference;         geoprocessTask.url = "http://tfsgis-iisd01:6080/arcgis/rest/services/TwoParametersWithSelection2/GPServer/CalcFeaturesStewardshipOneParameterSelection";      geoprocessTask.submitJob(params, null, null);   myAttributeTablespatial.visible = false   myFeatureLayerstewardship.visible = false   geoprocessTask.addEventListener(GeoprocessorEvent.JOB_COMPLETE,jobCompleteHandler);      geoprocessTask.addEventListener(FaultEvent.FAULT, faultHandler2);    }  private function jobCompleteHandler(e:GeoprocessorEvent):void         {     CursorManager.removeBusyCursor();     Alert.show("Plan ID created");          //myEditor.attributeInspector.refresh()     myAttributeTablespatial.refresh()        myFeatureLayerstewardship.refresh()     myAttributeTablespatial.visible = true     myFeatureLayerstewardship.visible = true         } 

View solution in original post

0 Kudos
1 Reply
ionarawilson1
Occasional Contributor III
I made the layer and the table invisible, then visible again when completed

  private function calculalteplanid():void     {      var  SelectingFeature:FeatureSet = new FeatureSet();   SelectingFeature.features = myFeatureLayerstewardship.selectedFeatures  SelectingFeature.fields = myFeatureLayerstewardship.layerDetails.fields      var features:ArrayCollection = ArrayCollection(myFeatureLayerstewardship.graphicProvider);   var featureSet:FeatureSet = new FeatureSet(features.source);   // or  // var featureSet:FeatureSet = new FeatureSet(features.toArray())     featureSet.fields = myFeatureLayerstewardship.layerDetails.fields   CursorManager.setBusyCursor();   var params:Object  = {    "Selecting_Features": SelectingFeature,    "Stewardship": featureSet   }       var geoprocessTask:Geoprocessor = new Geoprocessor();   geoprocessTask.outSpatialReference = myMap.spatialReference;         geoprocessTask.url = "http://tfsgis-iisd01:6080/arcgis/rest/services/TwoParametersWithSelection2/GPServer/CalcFeaturesStewardshipOneParameterSelection";      geoprocessTask.submitJob(params, null, null);   myAttributeTablespatial.visible = false   myFeatureLayerstewardship.visible = false   geoprocessTask.addEventListener(GeoprocessorEvent.JOB_COMPLETE,jobCompleteHandler);      geoprocessTask.addEventListener(FaultEvent.FAULT, faultHandler2);    }  private function jobCompleteHandler(e:GeoprocessorEvent):void         {     CursorManager.removeBusyCursor();     Alert.show("Plan ID created");          //myEditor.attributeInspector.refresh()     myAttributeTablespatial.refresh()        myFeatureLayerstewardship.refresh()     myAttributeTablespatial.visible = true     myFeatureLayerstewardship.visible = true         } 
0 Kudos