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.
Thanks for your help!
Ross
Can you post your code using the "Insert code sample" tool instead of in an image?
https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552
Done!
Your "aep" variable is an array, not a string value. If you want it to read the field, you can pass aep as "{WavePower}" and it will read the field that way. That syntax is described here.
https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html
Hi Rene,
Thank you, but unfortunately I have tried that and it does not fix the problem.
Ross