AnsweredAssumed Answered

Querytask and recordcount

Question asked by margaraiz on Oct 18, 2016
Latest reply on Oct 23, 2016 by margaraiz

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

Outcomes