artifact

PopupExpression and PopupManager relationship?

Discussion created by artifact on Sep 11, 2019

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?

Outcomes