How can I query multiple layers from the same program. For eg: I have 10 layers published in the ArcGis server (layer0, layer1......layer9), and I have all the layers turned on in the flex viewer. Now I want to click on the feature to display the attributes. Do I need to set up 10 QueryTask for this like....
Thanks Bob, for the reply. I did go in the FindTask direction and looked at its API. I believe it needs to have a "search text" against which the layers are checked for. My aim however is to click on the map and get the attribute pertaining to it. 1. Do you think I can replace the search with mouseclick event and it still works? 2. How can I know from the application the total number of layers published in the server as we still need to give the layerIds field for the layers to be searched?
1. The find task does not work with anything other than a string. 2. You would loop through the mapservices in the map and use the visibleLayers property of say the ArcGISDynamicMapServiceLayer. The layerIds property is not necessary if you want to search all the layers of a mapservice though.
Now I want to click on the feature to display the attributes.