Select to view content in your preferred language

AttributeTable not honoring FeatureLayer selection

566
0
02-19-2013 11:45 AM
NicholasRanicar
Emerging Contributor
Hi,
I have created my own AttributeTableComponent.mxml which is simply a resizeable window containing an AttributeTable. I have bound the AtttributeTable's featureLayer attribute to a variable in the component instance, so that the associated feature layer can be changed at runtime.

I am able to successfully create a FeatureLayer, set its mode to FeatureLayer.MODE_SELECTION and then call the selectFeatures method on it. This all appears to be working as expected and the feature layer has the correct number of selected features in it after selectFeatures is called.

I then set the AttributeTable's feature layer to this new feature layer instance and set an event listener on the feature layer load event. In the event handler I call the AttributeTable.refresh method and display the attribute table in a popup.

When I run my application and the feature layer is set to a layer with only a handful of features in it, all features are displayed in the attribute table and the selection set is highlighted. This is not the behaviour I would have expected given that the feature layer "mode" is set to MODE_SELECTION. I would have expected to see only the selected features in the attribute table.

For small datasets the above behaviour is not a problem because the selection set is still displayed in the attribute table. However, for larger datasets (>1000 features, with ArcServer set to return max. 1000 features), Flex throws a null reference error, presumably because the selected features didn't get returned in the first 1000 from the dataset.

How can I ensure that only the selected features from the feature layer are displayed by the AttributeTable? Is the AttributeTable behaving correctly? Have I just misunderstood how it's supposed to work?

Happy to post code if that helps....

thanks,
Nic
Tags (2)
0 Kudos
0 Replies