Dear esri flex team
I have a problem on controlling the number of attribute display fields when I use identifytask.Take the live code Identifysample as an example.
function "myResultFunction" as below is the identify result handling function.At the last line
"clickGraphic.attributes = resultGraphic.attributes"
all the attributes of the identify target are restored in resultGraphic.But I don't need all the fields of the attributes,I just need part of them.for example there is a road layer containing 3 fields of attribute,they are 'objectid','shape' and 'length',I don't need 'shape' field,I hope when I do the identify process,the popup window only shows 'objectid' and 'length'. I try to change the code as "clickGraphic.attributes = resultGraphic.attributes["objectid","length"]" but it doesn't work. I am wondering is there anyother way to realize it?
thanks in advance
private function myResultFunction(results:Array, clickGraphic:Graphic = null):void
{
if (results && results.length > 0)
{
var result:IdentifyResult = results[0];
var resultGraphic:Graphic = result.feature;
switch (resultGraphic.geometry.type)
{
case Geometry.MAPPOINT:
{
resultGraphic.symbol = smsIdentify;
break;
}
case Geometry.POLYLINE:
{
resultGraphic.symbol = slsIdentify;
break;
}
case Geometry.POLYGON:
{
resultGraphic.symbol = sfsIdentify;
break;
}
}
lastIdentifyResultGraphic = resultGraphic;
// update clickGraphic (from mouse click to returned feature)
clickGraphic.symbol = new InfoSymbol(); // use default renderer
clickGraphic.attributes = resultGraphic.attributes;
}
}