1

I am attempting to display related fields in a popup window. I've created a GraphicsLayer, consisting of features from the results of a QueryTask. Upon adding the features to the GraphicsLayer, I am assigning a popupTemplate to each feature:

var popupTemplate = {
 title: "<b>{LONGNAME}</b>",
 content: [{
 type: "fields",
 fieldInfos: [{
 fieldName: "SPACEID",
 label: "Space Identifier",
 visible: true
 },{
 fieldName: "relationships/1/VERTICALORDER",
 label: "Vertical Order",
 visible: true
 }]
 }]
};

However, this technique does not seem to be able to reference the related table. The [SPACEID] field value is visible, but the related field value is not. Am I doing something wrong, or is there a different way to accomplish this?

EDIT: Perhaps this functionality is not possible yet? I've tested this with a simple FeatureLayer, and the relationship is not honored.

var layer = new FeatureLayer({
 url: baseURL + "/2",
 popupTemplate: { // autocasts as new PopupTemplate()
 title: "<b>{LONGNAME}</b>",
 content: [{
 type: "fields",
 fieldInfos: [{
 fieldName: "SPACEID",
 label: "Space Identifier",
 visible: true
 },{
 fieldName: "relationships/3/FIRSTNAME",
 label: "Employee Name",
 visible: true
 }]
 }]
 }
});

I have verified the relationship is functioning, using the REST queryRelatedRecords window. However the FeatureLayer does not see the table. Is there something further that needs to be done? I should note that the service is a MapService, in case that matters.

This issue is discussed here and elsewhere.

Vince
20.5k16 gold badges49 silver badges65 bronze badges
asked May 22, 2018 at 18:15

1 Answer 1

0

fieldName: "relationships/1/VERTICALORDER" means that have created a second RelationShip in your GraphicLayer.

If you didn't, (otherwise you would have post the code) then you have two options :

answered May 23, 2018 at 13:46
1
  • I have a relationship for the MapService layer from which the features used to create the GraphicLayer came from. The GraphicLayer doesn't, as far as I can tell, have any relationships. Can you elaborate on how one would create a new relationship? Commented May 23, 2018 at 20:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.