AnsweredAssumed Answered

Adding a link to a popup and getting a value from the selected feature

Question asked by a00847138 on Oct 27, 2017
Latest reply on Nov 3, 2017 by a00847138

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 


line 99 onwards: 


   var link = html.create("a",{
   "class": "action",
   "id": "statsLink",
   "innerHTML": "Bridge Report", //text that appears in the popup for the link
   "href": "javascript: void(0);"
   }, query(".actionList", this.popupUnion.bigScreen.domNode)[0]);


   //when the link is clicked register a function that will run
   on(link, "click", this.calculateBridgeReport);


   calculateBridgeReport: function(){
   var feature = this.popupUnion.getSelectedFeatures();


I am receiving the following error:

Uncaught TypeError: Cannot read property 'getSelectedFeatures' of undefined 


I have looked here and here 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.