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()); }
Solved! Go to Solution.
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 }
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 }