Select to view content in your preferred language

Identify Results 2.2 getContent

943
1
03-18-2011 11:25 AM
JamesGormley
Deactivated User
is there a but with the getContent method on the Identify Resutls in javascript version 2.2.
using this tag...
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2"></script>

and then calling ...

function addToMap(idResults, evt) {
    Results = { displayFieldName: null, features: [] };
    //    parcelResults = { displayFieldName: null, features: [] };
    var tc = new dijit.layout.TabContainer({ style: "height: 100%; width: 100%;" });
    try {
        for (var i = 0, il = idResults.length; i < il; i++) {
            var idResult = idResults;
            if (idResult.layerId === 11) {
                if (!Results.displayFieldName) { Results.displayFieldName = idResult.displayFieldName };
                Results.features.push(idResult.feature);
                //Results.features.getContent()
//*************content is nulll at this point
                var content = Results.features.getContent();
                PID = Results.features.attributes['Parcel ID #'];
                saleTab = new dijit.layout.ContentPane({
                    title: "PID: " + PID,
                    content: content
                });
                tc.addChild(saleTab);
            }
        }
    }
    catch (Error) {
   
    }
    tc.startup();
    map.infoWindow.setTitle("Identify Results");
    map.infoWindow.width = 600;
   
    map.infoWindow.setContent(tc.domNode);
    // map.infoWindow.setContent(dijit.byId("tabs").domNode);
   // map.infoWindow.resize(315, 315);
    //map.infoWindow.setTitle(idResults.displayFieldName);
    showInfo(evt);
    //map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
}

guess its back to version 2.1
0 Kudos
1 Reply
KellyHutchins
Esri Frequent Contributor
At 2.1, getContent returned attributes as key/value pairs at 2.2, we didn't document this usage but we did use it in a few samples. At 2.2, the recommended approach is to use esri.substitute to get the information, here's a snippet that shows how this works:

esri.substitute(evt.graphic.attributes, "${*}")


We use this in the Find Closest Facilities sample.
0 Kudos