AnsweredAssumed Answered

Using two queries with a few different layers

Question asked by nonpoint1989 on Aug 6, 2013
Latest reply on Aug 8, 2013 by nonpoint1989
I have been working on finding samples that would give me an idea of where to go next. Alot of the sample I have found are back in the 1.6 javascript api
[HTML]http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/query_bypoly.html[/HTML]
The objective I have is that I would like to allow users to search for a polygon location from one layer, and use a second query to determine if a different layer intersects the graphic returned by that first query.

While I realize the code is old, does the code below add the first query's graphic to the map then call the second query?
var firstGraphic = null;         // +++++Listen for QueryTask onComplete event+++++         dojo.connect(queryTask, "onComplete", function(graphics) {           firstGraphic = graphics.features[0];           var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new dojo.Color([100,100,100]), 3), new dojo.Color([255,0,0,0.20]));           firstGraphic.setSymbol(symbol);           firstGraphic.setInfoTemplate(infoTemplate);            map.graphics.add(firstGraphic);           query.geometry = firstGraphic.geometry;           query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_TOUCHES;           queryTaskTouches.execute(query);           dojo.byId('messages').innerHTML = "<b>Executing Polygon Touches Query...</b>";

Outcomes