<?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 Enhanced Query widget not displaying results table in AT in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/enhanced-query-widget-not-displaying-results-table/m-p/814123#M6773</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have been using the &lt;A _jive_internal="true" href="https://community.esri.com/message/658283-enhanced-query"&gt;EnhancedQuery widget&lt;/A&gt; in WAB 2.5 and it works fine. Now we are trying it in WAB 2.12 but there is an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The EnhancedQuery widget executes a QueryTask and then calls publishData to send the query results to the AttributeTable. In 2.5, the query executes, the query layer is added to the LayerList and map, and the&amp;nbsp;AT opens and displays the query results table. In 2.12, everything is fine until the&amp;nbsp;AT opens and it says "No tables available to display". In the console there is this error: TypeError: Cannot read property 'getLayerObject' of undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Strangely, when I open the LayerList and click the three dots for the query result and select "View in Attribute Table", the&amp;nbsp;AT opens and displays the query results fine. So the problem is when the&amp;nbsp;AT is called from the EnhancedQuery widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though the query layer is in the LayerList and on the map it is not in ResourceManager layerInfosFromMap (or at least it's not there when the AT goes looking for it) so when the&amp;nbsp;AT function addLayerToTable calls the ResourceManager getLayerInfoById function to get the query layer from layerInfosFromMap, the query result is not in layerInfosFromMap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know what this means but I logged layerInfosFromMap.length to the console and it is 63 but when I logged the entire layerInfosFromMap object it says its length is 64 and the query layer is at the bottom. So maybe it is in there?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas of why there might be a problem adding a query layer to ResourceManager layerInfosFromMap?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Oct 2019 20:07:21 GMT</pubDate>
    <dc:creator>JohnKidd2</dc:creator>
    <dc:date>2019-10-15T20:07:21Z</dc:date>
    <item>
      <title>Enhanced Query widget not displaying results table in AT</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/enhanced-query-widget-not-displaying-results-table/m-p/814123#M6773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have been using the &lt;A _jive_internal="true" href="https://community.esri.com/message/658283-enhanced-query"&gt;EnhancedQuery widget&lt;/A&gt; in WAB 2.5 and it works fine. Now we are trying it in WAB 2.12 but there is an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The EnhancedQuery widget executes a QueryTask and then calls publishData to send the query results to the AttributeTable. In 2.5, the query executes, the query layer is added to the LayerList and map, and the&amp;nbsp;AT opens and displays the query results table. In 2.12, everything is fine until the&amp;nbsp;AT opens and it says "No tables available to display". In the console there is this error: TypeError: Cannot read property 'getLayerObject' of undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Strangely, when I open the LayerList and click the three dots for the query result and select "View in Attribute Table", the&amp;nbsp;AT opens and displays the query results fine. So the problem is when the&amp;nbsp;AT is called from the EnhancedQuery widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though the query layer is in the LayerList and on the map it is not in ResourceManager layerInfosFromMap (or at least it's not there when the AT goes looking for it) so when the&amp;nbsp;AT function addLayerToTable calls the ResourceManager getLayerInfoById function to get the query layer from layerInfosFromMap, the query result is not in layerInfosFromMap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know what this means but I logged layerInfosFromMap.length to the console and it is 63 but when I logged the entire layerInfosFromMap object it says its length is 64 and the query layer is at the bottom. So maybe it is in there?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas of why there might be a problem adding a query layer to ResourceManager layerInfosFromMap?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2019 20:07:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/enhanced-query-widget-not-displaying-results-table/m-p/814123#M6773</guid>
      <dc:creator>JohnKidd2</dc:creator>
      <dc:date>2019-10-15T20:07:21Z</dc:date>
    </item>
  </channel>
</rss>

