function buildPopupContent() {
var aep = [
{
'featureLayer': meanAnnualWaveResourceSelkie,
'fieldInfos': [
{
'fieldName': 'Wave_Power',
}
]
}
];
console.log("buildPopupContent")
let div = document.createElement("div");
div.innerHTML =
'<table><tr><td>AEP: <td>' + aep + '</td></tr>' +
'<tr><td>Project Life: <td><input type="number" name="defaultProjectLife" id="defaultProjectLife" style="width: 7em" value="20" min=1 max=100/><span id="defaultProjectLife_errors"></span></td></tr>' +
'<tr><td>Discount Rate: <td><input type="number" name="defaultDiscountRate" id="defaultDiscountRate" style="width: 7em" value="5" min=1 max=50/><span id="defaultDiscountRate_errors"></span></td></tr></table>' + '<BR>' +
'<div id="calculate_lcoe"><button onclick="calc_te()">Calculate</button></div>' + '<BR>' +
'<button></div>' +
'<table><tr><td>LCOE: <td><input type="text" name="lcoe" id="lcoe" style="width: 7em" disabled /></td></tr></table>'
return div;
}
Hi all.
My issue is with trying to include inputs and run calculations from a feature layer with popupTemplate in JS API. The template will accept the attribute input in the title section of the popup but not in the contents section where it is just appearing as '[object Object]'. The image below shows what happens upon activating the popup. I need to call the attribute value from the feature layer into the contents section so that it can be used as another input to the calculation of the LCOE output.

Another brief way of describing the issue is that I am unable to pass a feature layer variable into the content builder function. I also attach a snippet of some of the relevant section of code here.

Thanks for your help!
Ross