<?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 Re: Loading ajax content into infoWindow in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107400#M9964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm loading a bunch of points from JSON when my map loads. I create a graphic for each from a lat/lon pair. When a user clicks a point, I'd like to fire off a query based on a custom ID attribute I store with the graphic. I'd like to make a JSON request to the same server and pull back another JSON object to populate the infoWindow.&lt;BR /&gt;&lt;BR /&gt;My problem comes in because due to the async nature of Javascript, my "details" JSON object isn't ready while creating the initial info Template. I can't find an event to latch onto to fire off the query.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An option could be to reorganise your points into a featureLayer based on a featureCollection, as explained at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/featurelayer.html#featurelayer2" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/featurelayer.html#featurelayer2&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you were able to load the "details" object from the original JSON at the same time, there'd be no need to make a second request for this information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alternatively, you'd at least have a better mechanism for tying the original point to the second JSON request, based on a common ID.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 11:47:27 GMT</pubDate>
    <dc:creator>StephenLead</dc:creator>
    <dc:date>2013-05-28T11:47:27Z</dc:date>
    <item>
      <title>Loading ajax content into infoWindow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107399#M9963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm loading a bunch of points from JSON when my map loads. I create a graphic for each from a lat/lon pair. When a user clicks a point, I'd like to fire off a query based on a custom ID attribute I store with the graphic. I'd like to make a JSON request to the same server and pull back another JSON object to populate the infoWindow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem comes in because due to the async nature of Javascript, my "details" JSON object isn't ready while creating the initial info Template. I can't find an event to latch onto to fire off the query. If I attach to the onShow event, I have no knowledge of what graphic I clicked, and that event only fires as long as there are no open info windows (users do click on other map graphics while info windows are open... there's no event for that use case)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've hunted around for other examples of this, it seems like it would be a common thing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 03:22:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107399#M9963</guid>
      <dc:creator>JimWharton</dc:creator>
      <dc:date>2013-05-28T03:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Loading ajax content into infoWindow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107400#M9964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm loading a bunch of points from JSON when my map loads. I create a graphic for each from a lat/lon pair. When a user clicks a point, I'd like to fire off a query based on a custom ID attribute I store with the graphic. I'd like to make a JSON request to the same server and pull back another JSON object to populate the infoWindow.&lt;BR /&gt;&lt;BR /&gt;My problem comes in because due to the async nature of Javascript, my "details" JSON object isn't ready while creating the initial info Template. I can't find an event to latch onto to fire off the query.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An option could be to reorganise your points into a featureLayer based on a featureCollection, as explained at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/featurelayer.html#featurelayer2" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/featurelayer.html#featurelayer2&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you were able to load the "details" object from the original JSON at the same time, there'd be no need to make a second request for this information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alternatively, you'd at least have a better mechanism for tying the original point to the second JSON request, based on a common ID.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 11:47:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107400#M9964</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2013-05-28T11:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Loading ajax content into infoWindow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107401#M9965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;An option could be to reorganise your points into a featureLayer based on a featureCollection, as explained at &lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/featurelayer.html#featurelayer2"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/featurelayer.html#featurelayer2&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you were able to load the "details" object from the original JSON at the same time, there'd be no need to make a second request for this information.&lt;BR /&gt;&lt;BR /&gt;Alternatively, you'd at least have a better mechanism for tying the original point to the second JSON request, based on a common ID.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cool, I'll check it out. Currently I've added a click handler on the graphics layer which returns the graphic object that was clicked. I can use that and set the innerHTML property of one of my DIVs inside my infoWindow. Your solutions sounds more elegant.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 12:57:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107401#M9965</guid>
      <dc:creator>JimWharton</dc:creator>
      <dc:date>2013-05-28T12:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Loading ajax content into infoWindow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107402#M9966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jim,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a link to a sample that illustrates the feature collection approach Steve suggested: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/fl_featureCollection.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/fl_featureCollection.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The sample shows how to load photo information from Flickr and display it on the map. When the location is clicked the photo information is displayed in a popup window.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 21:57:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107402#M9966</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2013-05-28T21:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Loading ajax content into infoWindow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107403#M9967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's great! Thank you so much!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 12:13:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-ajax-content-into-infowindow/m-p/107403#M9967</guid>
      <dc:creator>JimWharton</dc:creator>
      <dc:date>2013-05-30T12:13:29Z</dc:date>
    </item>
  </channel>
</rss>

