<?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 I created a custom widget and I need create a queryTask to a table in the map. But I can not use new QueryTask. How I can do it?  in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/i-created-a-custom-widget-and-i-need-create-a/m-p/756153#M19806</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;define([&lt;BR /&gt; 'dojo/_base/declare',&lt;BR /&gt; 'jimu/BaseFeatureAction',&lt;BR /&gt; 'jimu/WidgetManager',&lt;BR /&gt; 'esri/tasks/query',&lt;BR /&gt; 'esri/tasks/QueryTask'&lt;BR /&gt; &lt;BR /&gt;], function(declare, BaseFeatureAction, WidgetManager){&lt;/P&gt;&lt;P&gt;var clazz = declare(BaseFeatureAction, {&lt;/P&gt;&lt;P&gt;iconFormat: 'png',&lt;/P&gt;&lt;P&gt;isFeatureSupported: function(featureSet){&lt;BR /&gt; return featureSet.features.length == 1 &amp;amp;&amp;amp; featureSet.features[0].attributes.state_name != undefined &amp;amp;&amp;amp; featureSet.features[0].attributes.state_name == 'Montana';&lt;BR /&gt; },&lt;/P&gt;&lt;P&gt;onExecute: function(featureSet){&lt;BR /&gt; WidgetManager.getInstance().triggerWidgetOpen(this.widgetId)&lt;BR /&gt; .then(function(myWidget) {&lt;BR /&gt;&lt;SPAN&gt; var queryTask = new QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fservices2.arcgis.com%2FzjX47EEgMzOqxwh7%2FArcGIS%2Frest%2Fservices%2FMapa%2FFeatureServer%2F1" rel="nofollow" target="_blank"&gt;http://services2.arcgis.com/zjX47EEgMzOqxwh7/ArcGIS/rest/services/Mapa/FeatureServer/1&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; var query = new Query();&lt;BR /&gt; query.returnGeometry = false;&lt;BR /&gt; query.outFields = [&lt;BR /&gt; "Bocas"&lt;BR /&gt; ];&lt;/P&gt;&lt;P&gt;query.text = "EquipoId = 'Eq1'";&lt;BR /&gt; queryTask.execute(query, showResults);&lt;/P&gt;&lt;P&gt;function showResults(results) {&lt;BR /&gt; var resultItems = [];&lt;BR /&gt; var resultCount = results.features.length;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; myWidget.ViewImage(resultCount);&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt; return clazz;&lt;BR /&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 May 2017 03:28:27 GMT</pubDate>
    <dc:creator>andreacarina</dc:creator>
    <dc:date>2017-05-30T03:28:27Z</dc:date>
    <item>
      <title>I created a custom widget and I need create a queryTask to a table in the map. But I can not use new QueryTask. How I can do it?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/i-created-a-custom-widget-and-i-need-create-a/m-p/756153#M19806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;define([&lt;BR /&gt; 'dojo/_base/declare',&lt;BR /&gt; 'jimu/BaseFeatureAction',&lt;BR /&gt; 'jimu/WidgetManager',&lt;BR /&gt; 'esri/tasks/query',&lt;BR /&gt; 'esri/tasks/QueryTask'&lt;BR /&gt; &lt;BR /&gt;], function(declare, BaseFeatureAction, WidgetManager){&lt;/P&gt;&lt;P&gt;var clazz = declare(BaseFeatureAction, {&lt;/P&gt;&lt;P&gt;iconFormat: 'png',&lt;/P&gt;&lt;P&gt;isFeatureSupported: function(featureSet){&lt;BR /&gt; return featureSet.features.length == 1 &amp;amp;&amp;amp; featureSet.features[0].attributes.state_name != undefined &amp;amp;&amp;amp; featureSet.features[0].attributes.state_name == 'Montana';&lt;BR /&gt; },&lt;/P&gt;&lt;P&gt;onExecute: function(featureSet){&lt;BR /&gt; WidgetManager.getInstance().triggerWidgetOpen(this.widgetId)&lt;BR /&gt; .then(function(myWidget) {&lt;BR /&gt;&lt;SPAN&gt; var queryTask = new QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fservices2.arcgis.com%2FzjX47EEgMzOqxwh7%2FArcGIS%2Frest%2Fservices%2FMapa%2FFeatureServer%2F1" rel="nofollow" target="_blank"&gt;http://services2.arcgis.com/zjX47EEgMzOqxwh7/ArcGIS/rest/services/Mapa/FeatureServer/1&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; var query = new Query();&lt;BR /&gt; query.returnGeometry = false;&lt;BR /&gt; query.outFields = [&lt;BR /&gt; "Bocas"&lt;BR /&gt; ];&lt;/P&gt;&lt;P&gt;query.text = "EquipoId = 'Eq1'";&lt;BR /&gt; queryTask.execute(query, showResults);&lt;/P&gt;&lt;P&gt;function showResults(results) {&lt;BR /&gt; var resultItems = [];&lt;BR /&gt; var resultCount = results.features.length;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; myWidget.ViewImage(resultCount);&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt; return clazz;&lt;BR /&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 03:28:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/i-created-a-custom-widget-and-i-need-create-a/m-p/756153#M19806</guid>
      <dc:creator>andreacarina</dc:creator>
      <dc:date>2017-05-30T03:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: I created a custom widget and I need create a queryTask to a table in the map. But I can not use new QueryTask. How I can do it?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/i-created-a-custom-widget-and-i-need-create-a/m-p/756154#M19807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to add in the arguments in the function to tell the code what QueryTask and Query are. If you examine the console, you should see errors indicating this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 13:52:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/i-created-a-custom-widget-and-i-need-create-a/m-p/756154#M19807</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-05-30T13:52:26Z</dc:date>
    </item>
  </channel>
</rss>

