AnsweredAssumed Answered

InfoTemplate Contents for Graphics are not visible after first click - only on IE

Question asked by sumit.zarkar on Jun 2, 2015
Latest reply on Aug 5, 2015 by jestanford

We are using "esri/InfoTemplate" to show infowindow for the Graphics.


And when we are setting any Node (element) as the content for infoTemplate we can see the infowindow properly only for first time , however next time onward  when we click on same graphic the blank infowindow is shown.


Following are our observations:

  1. If string is set as the content  for InfoTemplate then the infowindow is always shown properly.
  2. If an element is set as the content for InfoTemplate and when we click on the graphics for first time we can see the infowindow as expected. However from next click on the graphic the innerHTML of element(which is set as content) gets cleared(Empty).



Infowindow content when graphic is clicked for first time:


Infowindow content when same graphic is clicked for second time:

Below is the code Sample:


<!DOCTYPE html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!--The viewport meta tag is used to improve the presentation and behavior of the samples
      on iOS devices-->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    <title>Graphic InfoTemplate sample</title>
    <link rel="stylesheet" href="">
        html, body, #mapDiv
            padding: 0;
            margin: 0;
            height: 100%;
            display: block;
    <script src=""></script>
        var map;
        "esri/Color", "dojo/dom", "dojo/dom-construct", "dojo/on", "dojo/domReady!"
      ], function (
        Color, dom, domConstruct, on
      ) {
   //create symbol for graphic
          var markerSymbol = new SimpleMarkerSymbol();
          markerSymbol.setColor(new Color("#00FFFF"));
          var count = 1;//by default set graphic count to 1
          //create map
          map = new Map("mapDiv", { basemap: "streets", center: [-25.312, 34.307], zoom: 3});
          map.on("click", addGraphic);
          function addGraphic(evt) {
              var graphic, infoTemplate, templateDiv, templateButton;
              if (evt.graphic) {
                  //display infowindow if graphic is clicked.
              } else {
                  //create new graphic
                  graphic = new Graphic(evt.mapPoint, markerSymbol);
                  //create info template for graphic
                  infoTemplate = new InfoTemplate();
                  infoTemplate.setTitle("Graphic " + count);
   //create template containing DOM node
                  templateDiv = domConstruct.create("div", { "style": "background-color:grey; color:white; height:60px", 'innerHTML': "Graphic " + count }, null);
                  templateButton = domConstruct.create("button", {  'innerHTML': "Button for Graphic " + count }, templateDiv);
   //set Content 
   //set infoTemplate to graphic
   //Add Graphics on map
    <div id="mapDiv">



Steps to reproduce:

1.Click on map to add the graphics.

2.Now click on the graphic. (observe that you will see the text "Graphic 1" and a Button) :

3. Close the infowindow

4.Now click on the same graphic again. (observe that you will not see the text and Button) :