Viewing attribute information from related table in popup window

2997
2
11-04-2014 08:18 AM
StephenKing
New Contributor III

Hi,

I am trying to view attribute information from related tables in the popup window of a JavaScript viewer using:

identifies: {

    nameReports: {

        0: {

            title: 'Multimedia links',

            fieldInfos: [{

                 fieldName: 'OBJECTID',

                 visible: true

             }, {

                 fieldName: 'GIS ID',

                 label: 'GIS ID',

                 visible: true

             }, {

                 fieldName: 'relationships/0/GIS_ID',

                 label: 'GIS_ID',

                 visible: true

             }]

         }

    }

}

The output in the popup window shows the attribute information for 'OBJECTID' and 'GIS ID' from the feature's own table, but will not display the value for 'GIS_ID' from the related table.

Using Chrome's Developer Tools I can see the following error:

an error occurred when starting a widget embedded within InfoWindow: Cannot read property 'relationships' of undefined

Can anyone help me with this?

Many thanks.

0 Kudos
2 Replies
StephenKing
New Contributor III

As an update, I've found that the popup will display related information for a feature service but not a dynamic map service. I don't know why this is when the AGOL map viewer will happily show related information from a dynamic map service.


Stephen

AshishChoure
New Contributor II

Hi,

I am facing the same issue while fetching the popup of selected feature through getContent() method.

But the issue occurs only once.

If i click on any feature of particular layer, the console shows error saying "Cannot read property 'relationships' of undefined" and popup is not shown. Again clicking on feature(same feature or any other feature of the layer) console doesn't show any error and popup is shown as expected.

Not sure why this is happening.

Can any one help?

0 Kudos