Possible popup paging bug 4.10

379
2
03-04-2019 02:18 PM
ZorbaConlen1
Occasional Contributor III

Hi, I think I have found a bug with 4.10 version of the api. For popups, if multiple features are returned, a paging interface is shown in the popup with arrows to go to the next or previous feature. Works fine for most cases. But if you specify a function to return the content, there seems to be a bug. The initial graphic displayed is good, but additional graphics, only have the OID and display name fields (for attributes object). All other fields are not included as properties, and thus cannot be shown in the popup for any additional records.

This also seems like a good time to ask if there is a list of known bugs? That would be useful, for troubleshooting issues and also determining if I need to report a bug or if it has already been reported.

As mentioned, this is found with 4.10 version. When I rolled back to 4.9 version, it works fine.

Here are code snippets:

// Create a FeatureLayer - note, all fields returned
var featureLayer = new FeatureLayer({
    url: app.permitsFeatureLayer,
    outFields: ["*"]
});

//specify the template for the fl popup
featureLayer.popupTemplate = template;

/specify the function to create generate the template
var template = popup.getPopupContent();

//and here is how the function is called (separate module)
mo.getPopupContent = function () {
        var popupTemplate = {  
            title: '<strong>{ProjectName}<strong>',
            content: lang.hitch(this, function (info) {
              detailsDiv.innerHTML = <ul class="attr-list"><li>Address: <strong>' + info.graphic.attributes.Address + '</strong></li>' + 
              .....

        return detailsDiv;
        }
 return popupTemplate;
}
                ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

And logging the 'info' parameter - below is first feature, and 2nd image is the second feature returned after paging...

0 Kudos
2 Replies
BirajaNayak
Esri Contributor

Hi Zorba,

Try the below steps and let us know if that helps:

1. Export the feature class  and import back to your enterprise geodatabase or file geodatabase.

2. Republish the map service or feature service using the imported feature class in step1.

If this does not help, then please log a case with Esri Support Services.

Thanks,

Biraja

0 Kudos
ZorbaConlen1
Occasional Contributor III

Thanks for the idea Biraja,

I had already tried that with no luck. The data changes frequently, so I initially was using a query layer. As a test, I exported it to a feature class and tried using that. The bug was still present.

I have found a solution for this. I found that the popup class has an outFields property. When I added the fields there, it started working properly. Not sure if this is intended behavior or a bug. It seems a bit weird, as I would expect that specifying outfields as part of the feature layer would be enough. My popup object now looks like this:

var popupTemplate = {  // autocasts as new PopupTemplate()
     title: '<strong>{ProjectName}<strong>',
     outFields: app.popupFields,
     overwriteActions: true, //prevent default actions from showing
     actions: [this.customZoomAction],
     .....‍‍‍‍‍‍‍‍‍‍‍‍

Thanks

0 Kudos