A question was posted on the IdentifyWidget comments board about sorting the display order of the returned attributes. If you don't mind modifying code, this is an easy change to make.Note that this only affects the order of attributes for layers not explicitly defined in the IdentifyWidget.xml file. Layers which are defined in the config XML will have their attributes displayed in the order that they are defined in the fields list.In the onResult function of the IdentifyWidget.mxml, locate the following code:for (fld in obj){
try{
value = obj[fld] ? String(obj[fld]) : "";
} catch (error: Error) {
value = "";
}
value = value.replace(/>/g,">").replace(/</g,"<");
content += "<b>" + fld + ": </b>"+ value + "<br>";
}
Change it to:
var fldArray:ArrayCollection = new ArrayCollection();
for (fld in obj){
try{
value = obj[fld] ? String(obj[fld]) : "";
} catch (error: Error) {
value = "";
}
value = value.replace(/>/g,">").replace(/</g,"<");
// content += "<b>" + fld + ": </b>"+ value + "<br>";
// Instead of just printing out the fields as they appear, add
// them to an array so they can be sorted.
fldArray.addItem({name:fld, value:value});
}
// Sort the attributes
var sortField:SortField = new SortField("name"); // alpha, asc
var sort:Sort = new Sort();
sort.fields = [sortField];
fldArray.sort = sort;
fldArray.refresh();
var cur:IViewCursor = fldArray.createCursor();
while (!cur.afterLast) {
content += "<b>" + cur.current.name + ": </b>"+ cur.current.value + "<br>";
cur.moveNext();
}