Can anyone explain how to use the PopupExpressions of a PopupDefinition/Popup in relation to the PopupManager?
Let's say I have a simple PopupDefinition defined as below:
{
"allowDelete":false,
"allowEdit":false,
"allowEditGeometry":false,
"description":"",
"expressions":[{
"name":"expr1".
"title": "Expression Test",
"expression": "$feature.NAME",
"returnType":"string"
}],
"fields":[{
"fieldName":"NAME",
"format":null,
"isEditable":false,
"isVisible":true,
"label":"Name Label",
"stringFieldOption":"singleLine",
"tooltip":""
}],
"media":[],
"relatedFeaturesDefinition":null,
"showAttachments":true,
"showEditSummary":false,
"title":"{NAME}"
}
I can set this PopupDefinition to a FeatureLayer, query for Popups and get a result that shows both the Fields and Expressions are available. Passing the Popup to a PopupManager gives me access to the 'DisplayedFields' which I then use to bind to my view. Unfortunately, I don't understand how you access the expressions. I had thought that perhaps they could be referenced as PopupFields by adding additional Field values to the PopupDefinition such as the following:
{
"fieldName":"{expr1}",
"format":null,
"isEditable":false,
"isVisible":true,
"label":"Expression Label",
"stringFieldOption":"singleLine",
"tooltip":""
}
This however does not appear to work. How does one access PopupExpression results from a PopupManager?
7 months have passed and still no answer.... welcome to wix part 2
Did you also try it without the curly brackets, i.e. "fieldName":"expr1" ?
Thanks for the reply. I have tried it without the brackets. From what I can tell, there is no way to access popup expressions or popup media from the popup manager. I guess we could go into the popupmanager get the popup, then fetch the field value and perform the expression manually, but this seems ridiculous. Sure would be nice if esri or someone who understands the relationship to chime in.