Has anyone ever put the results of a RelationshipQuery() into a map.infoWindow that's been replaced with a dijit.popup?
Here's the workflow: User clicks a point, and all identify results are put into popup. <--this part is fine
I'm struggling with calling a relationshipquery, then putting the results into the infoTemplate.
The function findRelatedRecords performs 3 relationship queries and assembles an array of objects that are related to the single point. I cannot get this data back into the executeIdentifyTask function.
The function getWindowContent takes the relationshipquery array and converts it to html and constructs a dijit.tabcontainer & 2 contentpanes (tabs). It return the tabcontainer.domNode.
Any help? I'm really struggling!!
function executeIdentifyTask(evt) {
facSel.clearSelection();
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;
var deferred = identifyTask.execute(identifyParams);
deferred.addCallback(function(response) {
// response is an array of identify result objects
// Let's return an array of features.
return dojo.map(response, function(result) {
var feature = result.feature;
console.log(result);
//feature.attributes.layerName = result.layerName;
if(result.layerName === 'parcel_area2'){
//console.log(feature.attributes.site_code);
var template = new esri.InfoTemplate("", "${site_code} <br/> Owner of record: ${facil_loca}");
feature.setInfoTemplate(template);
}
else if (result.layerName === 'logistics2'){
var template = new esri.InfoTemplate("", "Parcel ID: ${Type}");
feature.setInfoTemplate(template);
}
else if (result.layerName === 'query2'){
findRelatedRecords(feature,evt) //<--get relationship query results here
var template = new esri.InfoTemplate("", getWindowContent(data,evt.graphic));
feature.setInfoTemplate(template);
}
return feature;
});
});
// InfoWindow expects an array of features from each deferred
// object that you pass. If the response from the task execution
// above is not an array of features, then you need to add a callback
// like the one above to post-process the response and return an
// array of features.
map.infoWindow.setFeatures([ deferred ]);
map.infoWindow.show(evt.mapPoint);
}