AnsweredAssumed Answered

InfoWindow title not showing on first occurrence.

Question asked by geonetadmin on May 11, 2011
Latest reply on May 11, 2011 by geonetadmin
Original User: odoe

So I'm coming across a little annoyance in my app when it comes to setting the InfoWindow title.
I have a FeatureLayer that I listen for click events.
dojo.connect(featureLayer, 'onClick', function(e){
 var g = e.graphic;
 map.infoWindow.resize(260, 175);
 ParcelData.GetDetailedInfoTemplate(map, featureLayer, g.attributes.AIN);
});

I use the click event to send a request to one of our web services to pull in some more detailed information about this item that was clicked, in this case Parcel information.

Once I have the detailed info, I create an InfoTemplate with the returned attributes and attach it to the FeatureLayer.
var infoTemplate = buildParcelInfoTemplate(g.attributes); // small function to parse attributes to HTML
featureLayer.setInfoTemplate(infoTemplate);


This works great and is suprisingly fast.
The issue I am having is that the first time I click on an item in the FeatureLayer, everything fires as it should and I can verify the FeatureLayer InfoTemplate is being populated by my InfoTemplate, but it does not show up.

So I added this little bit after assigning the InfoTemplate
if (!map.infoWindow.isShowing) {
 map.infoWindow.setTitle("Parcel");
 map.infoWindow.setContent(infoTemplate.content);
 map.infoWindow.show(esri.graphicsExtent(featureSet.features).getCenter());
}


This will work as far as showing the InfoWindow with my InfoTemplate content, but the title is still empty.

Every other click of the FeatureLayer after the first one works perfectly, it's just the first click event that this happens on.

I added a couple of image atachments to show what is happening.
I have tested in both Chrome 9.0.597.84 and IE8 with the same results.

It's not a deal breaker, but is a little annoying. Is there some step I am missing or any suggestions on possible remedies?
Thanks.

Attachments

Outcomes