<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic infoTemplates and featureTemplates in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infotemplates-and-featuretemplates/m-p/637971#M59600</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to edit the infoTemplate for a featureTemplate that I created. Basically, I want to change the format from the standard one that comes with the template picker.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Dec 2010 22:51:01 GMT</pubDate>
    <dc:creator>mdonnelly</dc:creator>
    <dc:date>2010-12-08T22:51:01Z</dc:date>
    <item>
      <title>infoTemplates and featureTemplates</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infotemplates-and-featuretemplates/m-p/637971#M59600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to edit the infoTemplate for a featureTemplate that I created. Basically, I want to change the format from the standard one that comes with the template picker.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Dec 2010 22:51:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infotemplates-and-featuretemplates/m-p/637971#M59600</guid>
      <dc:creator>mdonnelly</dc:creator>
      <dc:date>2010-12-08T22:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: infoTemplates and featureTemplates</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infotemplates-and-featuretemplates/m-p/637972#M59601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not 100% sure this is the easiest way to go but it looks like I can use the feature template picker without the editor and program all the editor stuff myself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not exactly what I want to do as I like all the default editor handling. It's a hell of a work around just to get control of the infoTemplate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have any better ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Dec 2010 22:16:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infotemplates-and-featuretemplates/m-p/637972#M59601</guid>
      <dc:creator>mdonnelly</dc:creator>
      <dc:date>2010-12-19T22:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: infoTemplates and featureTemplates</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infotemplates-and-featuretemplates/m-p/637973#M59602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm attempting to replace the editor widget with my own code to get greater control of the infotemplate. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I create a new feature using the template picker I then want to show an info window with the attributes of that feature class. However, I'm running into problems:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use the 'onDrawEnd' event with the following code, the info window does not show the attributes. It simply shows the literal infoTemplate string: '{*}'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.connect(drawToolbar, "onDrawEnd", function(geometry) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar.deactivate();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editToolbar.deactivate();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var newAttributes = dojo.mixin({},selectedTemplate.template.prototype.attributes);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectedTemplate.featureLayer.applyEdits([newGraphic], null, null);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var infoTemplateInst = new esri.InfoTemplate("Attributes", "${*}");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newGraphic.setInfoTemplate(infoTemplateInst);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.show(map.toScreen(newGraphic.geometry), map.getInfoWindowAnchor(map.toScreen(newGraphic.geometry)));
 });
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use the 'onBeforeApplyEdits' event with the following code, info window does not show or is initially blank.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.connect(featureLayers&lt;J&gt;,"onBeforeApplyEdits", function(adds,updates,deletes) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.forEach(adds, function(add) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var infoTemplateInst = new esri.InfoTemplate("Attributes", "${*}");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add.setInfoTemplate(infoTemplateInst);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.show(map.toScreen(add.geometry),&amp;nbsp;&amp;nbsp;&amp;nbsp; map.getInfoWindowAnchor(map.toScreen(add.geometry)));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
 });
&lt;/J&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use the 'onClick' even with the following code it does work but it is initially blank. After I click again on the new feature, the info window displays correctly and continues to for subsequently created features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.connect(featureLayers&lt;J&gt;, 'onClick', function(e) {
&amp;nbsp; var infoTemplateInst = new esri.InfoTemplate("Attributes", "${*}");
&amp;nbsp; e.graphic.setInfoTemplate(infoTemplateInst);
&amp;nbsp; map.infoWindow.show(map.toScreen(e.graphic.geometry),&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.getInfoWindowAnchor(map.toScreen(e.graphic.geometry)));
});
&lt;/J&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has someone got an example of creating a new feature and then displaying an info window with the feature's attributes?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infotemplates-and-featuretemplates/m-p/637973#M59602</guid>
      <dc:creator>mdonnelly</dc:creator>
      <dc:date>2021-12-12T03:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: infoTemplates and featureTemplates</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infotemplates-and-featuretemplates/m-p/637974#M59603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, my first example for 'onDrawEnd' is missing the line that creates a the new graphic:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.connect(drawToolbar, "onDrawEnd", function(geometry) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar.deactivate();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editToolbar.deactivate();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var newAttributes = dojo.mixin({},selectedTemplate.template.prototype.attributes);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var newGraphic = new esri.Graphic(geometry,null,newAttributes);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectedTemplate.featureLayer.applyEdits([newGraphic], null, null);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var infoTemplateInst = new esri.InfoTemplate("Attributes", "${*}");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newGraphic.setInfoTemplate(infoTemplateInst);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.show(map.toScreen(newGraphic.geometry), map.getInfoWindowAnchor(map.toScreen(newGraphic.geometry)));
 });
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note, I have also tried putting the setInfoTemplate statement before the applyEdits statement but it made no difference.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:43:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/infotemplates-and-featuretemplates/m-p/637974#M59603</guid>
      <dc:creator>mdonnelly</dc:creator>
      <dc:date>2021-12-12T16:43:29Z</dc:date>
    </item>
  </channel>
</rss>

