infoWindows don't appear - but only sporadically

Discussion created by stevel on Jan 9, 2011
I have the dreaded non-reproducible problem, whereby infoWindows work well 95% of the time, but inexplicably don't work at other times.

Working with featureLayers, I'm running a click event on the featureLayer to highlight the whole polygon when the user clicks a location within the polygon. The relevant code fragments appear below.

dojo.connect(featureLayer, "onClick", executeQueryTask);

function executeQueryTask(evt) {
    featureSet = null;
    queryTask = new esri.tasks.QueryTask(this.url);
    query = new esri.tasks.Query();
    query.outSpatialReference = spatRef;
    query.returnGeometry = true;
    query.outFields = ["*"];
    query.timeExtent = map.timeExtent;
    query.geometry = evt.mapPoint;
    queryTask.execute(query, function(fset) {
        var feature = fset.features[0];;
Note that I'm not explicitly telling the infoWindow to display -  presumably clicking on the feature in a featureLayer is causing the  infoWindow to show.

The problem is that on occasion the infoWindow doesn't appear - the feature is still highlighted in this case, so I know the function is running. Clicking another feature doesn't show the infoWindow - it's necessary to refresh the page to remove the problem. Unfortunately my server is not yet externally facing. ArcGIS Server 10.0 using the JSAPI v2.1

Basically I guess I'm asking whether anyone else has noticed this problem, and if you have any suggestions to fix it.