Select to view content in your preferred language

PopupTemplate fieldInfo formatting weird behaviour

655
2
07-16-2019 03:40 AM
ShakilChoudhury
Regular Contributor

Why does the first reference to myFieldName in the content work fine, outputting "431467" but the second reference in the href of the link output as "431,467", which breaks the link? On version 4.12.

          popupTemplate:{
            title: "My Popup",
            content:"{myFieldName} <a href='https://mysite.co.uk/PDFs/{myFieldName}.pdf'>View Order</a>",
            fieldInfos:[
              {
                fieldName: "myFieldName",
                format: {
                  places:0,
                  digitSeparator: false
                }
              }
            ]
          }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
Tags (2)
0 Kudos
2 Replies
ShakilChoudhury
Regular Contributor

The formatting only breaks when the field is added to the href attribute, if I add it to the class attribute it works fine.

0 Kudos
LizEidsness
Regular Contributor

I think it's a bug.  You could try a workaround of making an expression that converts value to string and try that?  I think it's Text($feature.myFieldName).

https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfo...

0 Kudos