Hi all:
For the first time I'm performing a few queries that are not near-instant. One query will return up to 2000 points from a dataset of over 100 000. I'm noticing that it freezes everything until the query is returned. The Flex Viewer and Firefox simply hang for 20+ seconds. Is this normal? I always thought that an AsyncResponder would listen for the server to return the data and then trigger the success or fail function the next chance it got.
My implementation looks like this:
I have also tried to run this where the success/fail functions are independent of the parent function.
For the first time I'm performing a few queries that are not near-instant. One query will return up to 2000 points from a dataset of over 100 000. I'm noticing that it freezes everything until the query is returned. The Flex Viewer and Firefox simply hang for 20+ seconds. Is this normal? I always thought that an AsyncResponder would listen for the server to return the data and then trigger the success or fail function the next chance it got.
My implementation looks like this:
Code:
protected function navigatorcontent1_tabEnabledChangeHandler(event:Event):void
{
surveyPointsQuery.where = "surveyid = " + surveyAttributes.surveyid.toString();
surveyPointsQueryTask.execute(surveyPointsQuery, new AsyncResponder(queryResult,queryFault));
function queryResult(fset:FeatureSet, token:Object = null):void
{
loadSurveyPoints(fset);
}
function queryFault(event:FaultEvent):void
{
Alert.show(event.toString());
}
}
Code:
<esri:QueryTask id="surveyPointsQueryTask"
useAMF="true"
url="http://validurl/MapServer/0"/>
<esri:Query id="surveyPointsQuery"
returnGeometry="true"
outFields="*"
outSpatialReference="{map.spatialReference}"/>