I recently tried updating an app to allow adding selections to a FeatureLayer. This is using the 2.4 Flex API (want to avoid updating for the moment).
I'm not doing any editing, I'm just loading the FeatureLayer with a service url like so
I create my FeatureLayer like so
This thread suggests that I should use FeatureLayer.SELECTION_ADD when initializing, but when I did that, no selections worked.
fLayer.mode = FeatureLayer.MODE_SELECTION
Anyway, I can do a selection using the default "new"
Then when I try to add to this selection at some point after the results are shown
fLayer.selectFeatures( query, FeatureLayer.SELECTION_NEW, new AsyncResponder( onSewerFeaturesSelected, onFault ));
It doesn't add new features to the selection, it just does a new selection and clears what was previously selected.
fLayer.selectFeatures( query, FeatureLayer.SELECTION_ADD, new AsyncResponder( onSewerFeaturesSelected, onFault ));
These queries are being done via a geometry if that matters.
Maybe I'm misunderstanding what FeatureLayer.SELECTION_ADD does when in FeatureLayer.MODE_SELECTION.
I can probably work around it by saving my selected graphics and adding them back, but I would think the above method should work.