Select to view content in your preferred language

EditTool - how do I know that I have selected a graphic and ready to edit?

582
1
10-19-2012 03:51 PM
stevemclaughlin
Occasional Contributor
Hi, how do I know that my EditTool has selected a graphic and ready to edit?  on the screen it highlights the graphic and puts a bounding box around it, is there an event that tells me it's ready?

thanks,

I'm looking at the flex API Sample/Tools/Using Edit tool (and more)
Tags (2)
0 Kudos
1 Reply
IvanBespalov
Frequent Contributor
FeatureLayer has event selectionComplete. Handle it:
...
myFeatureLayer1.addEventListener(FeatureLayerEvent.SELECTION_COMPLETE, onSelectionComplete);
myFeatureLayer2.addEventListener(FeatureLayerEvent.SELECTION_COMPLETE, onSelectionComplete);
...
or in mxml tag
...
<esri:FeatureLayer id="myFeatureLayer1"
                          selectionComplete="onSelectionComplete(event)"
                          ... />
<esri:FeatureLayer id="myFeatureLayer2"
                          selectionComplete="onSelectionComplete(event)"
                          ... />
...
protected function onSelectionComplete(event:FeatureLayerEvent):void
{
    event.featureLayer // Reference to the associated FeatureLayer
    event.featureLayer.selectedFeatures // selected features
    ...
}
...
0 Kudos