Select to view content in your preferred language

Open info window on first click

657
4
07-06-2011 11:29 AM
GerardoArmendariz
Deactivated User
What is the best way to open up an info window on first click?

I have a Graphics Layere in my map:
<esri:GraphicsLayer id="graphicsLayer" infoWindowRenderer="rdss.renderers.AllotmentGraphRenderer"/>


I am listening for an onclick event in my map:
mapClick="onMapClick(event)"

Inside the onMapClick function, I am querying a dataset and adding the feature that the user clicked on to the graphics layer:
graphicsLayer.graphicProvider = allotFSet.features[0];

I have to click once more to open the info window based on my AllotmentGraphRenderer.

Could you please point me to why this is happening and how to force the info window to open as soon as the graphicsLayer is populated with a graphic?

Thanks!
Tags (2)
0 Kudos
4 Replies
SaurabhGupta
Emerging Contributor
Hi,

You can probably try something similar as this sample :
http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=FeatureLayer_MouseOver_Snapshot


Regards.
0 Kudos
GerardoArmendariz
Deactivated User
Thanks for your suggestion. I was stuck on functionality prior to the FeatureLayer.  I will give it a try.
0 Kudos
GerardoArmendariz
Deactivated User
Looking through the documentation, I just noticed that spatialRelationship are not allowed with the FeatureLayer.  So, I guess I have to go back to my first approach using the QueryTask and the GraphicsLayer. 

Do you know of any way to automatically open up the infoWindow on the first click (when the feature is selected)?
0 Kudos
SaurabhGupta
Emerging Contributor
You can also do this way :

On your GraphicsLayer, you can listen for graphicAdd event and then add MouseEvents on those graphics. In the same way as done in the sample for FeatureLayer and its graphics.
0 Kudos