<?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 Adding a link to a popup and getting a value from the selected feature in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/adding-a-link-to-a-popup-and-getting-a-value-from/m-p/794976#M4555</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My ultimate goal is to run a geoprocessing service from a link in a popup but at the moment am trying to retrieve an attribute value to use as a input parameter from the selected attribute. I have added the following code to the PopupManager.js&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;line 99 onwards:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var link = html.create("a",{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;"class": "action",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;"id": "statsLink",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;"innerHTML": "Bridge Report", //text that appears in the popup for the link&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;"href": "javascript: void(0);"&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}, query(".actionList", this.popupUnion.bigScreen.domNode)[0]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//when the link is clicked register a function that will run&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;on(link, "click", this.calculateBridgeReport);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;calculateBridgeReport: function(){&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var feature = this.popupUnion.getSelectedFeatures();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(feature);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am receiving the following error:&lt;/P&gt;&lt;P&gt;Uncaught TypeError: Cannot read property 'getSelectedFeatures' of undefined&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have looked&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/3/jssamples/gp_popuplink.html"&gt;here&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/193180-gp-link-in-popup-panel-widget"&gt;here&lt;/A&gt;&amp;nbsp;but have not been able to get values returned. I am guessing the this.popupUnion is not what I should be using with getSelectedFeatures but am not sure what to do. Thanks in advance for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Oct 2017 22:39:57 GMT</pubDate>
    <dc:creator>MarkEastwood</dc:creator>
    <dc:date>2017-10-27T22:39:57Z</dc:date>
    <item>
      <title>Adding a link to a popup and getting a value from the selected feature</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/adding-a-link-to-a-popup-and-getting-a-value-from/m-p/794976#M4555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My ultimate goal is to run a geoprocessing service from a link in a popup but at the moment am trying to retrieve an attribute value to use as a input parameter from the selected attribute. I have added the following code to the PopupManager.js&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;line 99 onwards:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var link = html.create("a",{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;"class": "action",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;"id": "statsLink",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;"innerHTML": "Bridge Report", //text that appears in the popup for the link&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;"href": "javascript: void(0);"&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}, query(".actionList", this.popupUnion.bigScreen.domNode)[0]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//when the link is clicked register a function that will run&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;on(link, "click", this.calculateBridgeReport);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;calculateBridgeReport: function(){&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var feature = this.popupUnion.getSelectedFeatures();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(feature);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am receiving the following error:&lt;/P&gt;&lt;P&gt;Uncaught TypeError: Cannot read property 'getSelectedFeatures' of undefined&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have looked&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/3/jssamples/gp_popuplink.html"&gt;here&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/193180-gp-link-in-popup-panel-widget"&gt;here&lt;/A&gt;&amp;nbsp;but have not been able to get values returned. I am guessing the this.popupUnion is not what I should be using with getSelectedFeatures but am not sure what to do. Thanks in advance for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 22:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/adding-a-link-to-a-popup-and-getting-a-value-from/m-p/794976#M4555</guid>
      <dc:creator>MarkEastwood</dc:creator>
      <dc:date>2017-10-27T22:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a link to a popup and getting a value from the selected feature</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/adding-a-link-to-a-popup-and-getting-a-value-from/m-p/794977#M4556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ME,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I think that you are having a simple scope issue with your function:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;link&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"click"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;calculateBridgeReport&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You will notice this in the code in your second link when I replied to the Lesi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Oct 2017 03:47:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/adding-a-link-to-a-popup-and-getting-a-value-from/m-p/794977#M4556</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-10-28T03:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a link to a popup and getting a value from the selected feature</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/adding-a-link-to-a-popup-and-getting-a-value-from/m-p/794978#M4557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Robert. I am now getting&amp;nbsp;this.popupUnion.getSelectedFeature is not a function. I noticed in your reply to Lesi that you use this.popup.getSelectedFeature and this.popup is set to this.map.infoWindow. Is this something I need to do within the PopupManager.js?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Oct 2017 05:12:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/adding-a-link-to-a-popup-and-getting-a-value-from/m-p/794978#M4557</guid>
      <dc:creator>MarkEastwood</dc:creator>
      <dc:date>2017-10-29T05:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a link to a popup and getting a value from the selected feature</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/adding-a-link-to-a-popup-and-getting-a-value-from/m-p/794979#M4558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to expose the value that I was looking for by adding the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var feature = this.mapManager.map.infoWindow.getSelectedFeature();&lt;BR /&gt; var fs = feature.attributes.bridge_name_num;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 16:17:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/adding-a-link-to-a-popup-and-getting-a-value-from/m-p/794979#M4558</guid>
      <dc:creator>MarkEastwood</dc:creator>
      <dc:date>2017-11-03T16:17:55Z</dc:date>
    </item>
  </channel>
</rss>

