Select to view content in your preferred language

Web Map Popup - Custom Attribute Display in Runtime WPF popup

785
2
04-28-2022 02:00 PM
KeithGanzenmuller
Frequent Contributor

I have a Portal webmap that we use in an Experience Builder app. The user clicks or touches a polygon and the popup displays a single item which is hyperlink text that opens a virtual folder. Works well. 

Using the same webmap to serve data to a WPF Runtime app. Clicks work. I can retrieve the data and display it in a popup. If I set the layer popup to a list of attributes all the attributes display. If I set the layer's popup to be a custom attribute display, the popup shows the link text but not as a clickable hyperlink.

If I stop at a breakpoint I see:

popup.CorePopup.PopupDefinition.Description

<a href='{folderLink}' rel='nofollow ugc' target='_blank'>PrePlan Documents</a>

 

which looks correct. 

Is there any way to grab the actual custom display? If not is there a way to programmatically create the hyperlink in the popup?

I can think of a few workarounds but being new to the Runtime and WPF environment I was wondering if custom attribute links are available?

Keith

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor

PopupDefinition.Description is the definition with templated parameters.
To get the value for a specific Popup, you can use PopupManager.CustomDescriptionHtml

KeithGanzenmuller
Frequent Contributor

Thank you for the reply. 

Clearly that contains the custom HTML. When is inspect MyPopupViewer.PopupManager.CustomDescriptionHtml; it shows as attached. Clickable link works great. 

I've attempted several ways of displaying that in the popup to no avail. As I've indicated this is my first foray into Runtime. 

Fairly simple code:

                       FeatureLayer incidentLayer = StationConstants.sfdTargetHazards_FL; 
                        var result = await myMapView.IdentifyLayerAsync(
                            incidentLayer,
                            e.Position,
                            15,
                            false
                        );
                        Popup popup = result.Popups.FirstOrDefault();
                        MyPopupViewer.PopupManager = new PopupManager(popup);
                        popupGrid.Visibility = Visibility.Visible;

Tried some things that clearly do not work such as:

 MyPopupViewer.PopupManager.Popup.PopupDefinition.Description = MyPopupViewer.PopupManager.CustomDescriptionHtml;

That code shows the link text but not as a hyperlink. The PopupManager.ShowCustomDescriptionHtml returns true. 

I'll continue to research and experiment. If anyone has some direction for me, much appreciated. 

 

0 Kudos