How to perform multiple querytasks?

Discussion created by kangdon on Mar 23, 2011
Latest reply on Mar 30, 2011 by DSwingley-esristaff
I would like to perform series of querytasks.
Based on the first query results, I would like to perform a second query.
And when second query is complete, I would like to show the results in a popup window.

Attached example do seemed to work, but behaves little weird.
I've added Alert to the script.
On a first map click to select a state, everything seems to work correctly. And I get one alert notice.
On my next map click to select another state, again things seems to work correctly, but this time I get about 4 alerts. Value of previous selection gets displayed on the info window.
On my third map click, I get about 10 alert popups.

Looks like the querytasks that I have setup somehow remembers all the previous queries and loops through whenever I do mouse click on the map.
Can anyone see why this is happening???


Don Kang