InfoTemplate not showing all fields

3094
13
10-10-2011 07:11 AM
deleted-user-VeZur_n9o0OZ
Deactivated User
Hi all,

I'm having some difficulty adding a simple info window to my app. I'm following a walkthrough which has told me to create an InfoTemplate and feed it some html. However the resulting pop up only displays a couple of fields: my OBJECTID and the display field used for symbology when the resource was published to the server. I need my pop up to display all/a selection of fields. My code below:



    var content = "${*}";
    //var content = "<b> MSOA Area </b>: ${MSOA_AREA} <br/>";
    // content = content + "<b> Mean Gross Annual Income </b>: ${INCOME_AVG_YEARLY_GROSS} <br/>";
    // content = content + "<b> Target Age Population </b>: ${TARGET_AGE_POP} <br/>";
    // content = content + "<b> Visitor Volume 19th July 2011 </b>: ${MAX_ADJ_VOL_190711} <br/>";
    // content = content + "<b> Visitor Volume 23rd July 2011</b>: ${MAX_ADJ_VOL_230711} <br/>";
    // content = content + "<b> Visitor Volume Difference </b>: ${MAX_ADJ_VOL_DIFF}";

    var infoTemplate = new esri.InfoTemplate("Westfield Origin Destination", content);

    //feature layer
    var flURL = "http://SERVER/ArcGIS/rest/services/Maps/TSB_OD_Operational/MapServer/3";
    featureLayer = new esri.layers.FeatureLayer(flURL, {
     mode : esri.layers.FeatureLayer.MODE_ONDEMAND,
     //outfields : ["MSOA_AREA","INCOME_AVG_YEARLY_GROSS","TARGET_AGE_POP","MAX_ADJ_VOL_190711","MAX_ADJ_VOL_230711","MAX_ADJ_VOL_DIFF"],
     infoTemplate : infoTemplate
    });

    map.addLayers([basemap, featureLayer]);


Anyone have any pointers?

Thanks in advance!
James
0 Kudos
13 Replies
KellyHutchins
Esri Notable Contributor
There's a typo in your code that adds the parking info:

change the all lowercase outfields to mixed case (outFields)
outfields: ["*"],


outFields: ["*"],
0 Kudos
BenReilly
Emerging Contributor
Thanks for catching that, Kelly. That got the InfoTemplate working just perfectly. I must have looked at that line a dozen times and never caught it.

James, it looks like you might have the same typo in the code you originally posted. Does changing outfields to outFields fix your problem, too?
0 Kudos
deleted-user-VeZur_n9o0OZ
Deactivated User
Certainly did fix it! Thanks a lot Kelly. Great start to my day.

Just reading your post here Kelly about the code assist plugin:
http://forums.arcgis.com/threads/41685-Code-Assist-plugin-for-ArcGIS-JavaScript-API-2.5-not-availabl......

Would the typo above be picked up by a working plugin? Would be really handy.

Thanks again,
James
0 Kudos
Astonjacket
New Contributor

This is an excellent article. This is, in my opinion, one of the best posts ever written. Your work is excellent and inspiring. Thank you very much. Jack Daniel’s Jacket

0 Kudos