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.