Hi,
I have a widget for permorming a query and draw some elements in the map. When I execute my query with the querytask I also write in a label "X record founded".
(...)
queryTask.execute(query, dojo.hitch(this, "drawRecords"));
},
drawRecords: function (featureSet) {
(...)
this.shelter.hide();
dojo.byId("myLabel").innerHTML = "X record founded";
}
And this works fine when I have >1 records in the featureset, BUT when I have zero results, drawRecords function is not triggered, so the shelter never disappeared and the message tellin 0 record founded never appears.
I have try several things, but nothing is working.. I know that querytask has the methoth "executeForCount" but I am not sure how to use it and if i need to keep the "normal" execute in order to execute the query or if with one is enough..
any help?
Thanks!
Marga
Solved! Go to Solution.
Marga,
Strange.. Even if the query results no results you should still get to the complete event handler.
You should add an on error handler to see what is going wrong.
queryTask.execute(query, dojo.hitch(this, drawRecords), dojo.hitch(this, function(err){console.log(err);});
Marga,
Strange.. Even if the query results no results you should still get to the complete event handler.
You should add an on error handler to see what is going wrong.
queryTask.execute(query, dojo.hitch(this, drawRecords), dojo.hitch(this, function(err){console.log(err);});
You were rigth, it was an error not handled.
Thanks!