MapView.identifyLayer seems to work well, it fires off a single request and returns a Feature object which has all the feature's fields and attributes. That feature comes from an instance of FeatureTable that I never created directly and prior to this query had no reference to, so I'm a bit weary to trust it.
FeatureLayer.selectFeaturesWithQuery is used in the feature attribute update example. This sent me down a very confusing path as I didn't realize that waiting for the feature to "load" after you've already waited for the feature response was necessary. I now see this in the example, but I was originally working from the documentation which doesn't say anything about this. Feature is a loadable, but it's not mentioned that while the feature object and its properties/methods are usable before loading, that the feature's attributes aren't all available until after loading. The peculiar part about this is that it results in having to wait for two chained requests in order to accomplish what a single request would have accomplished, thus making a non-loadable version actually faster.
FeatureTable.queryFeatures seems to work the exact same as selectFeaturesWithQuery, only you obviously have to select the feature yourself if you want it selected.
I noticed that I can actually just use MapView.identifyLayer's result as my feature object, even though it comes from an unknown FeatureTable. This results in only a single request being fired off, but literally the exact same response as doing the triple-request chain that occurs in the example.
My questions:
I confirmed this can be seen in the feature attribute update example if you monitor http requests. The initial click triggers two requests, and hitting update triggers another. All 3 requests query for the same feature.
Where does MapView.identifyLayer get its FeatureTable instance? It's different than the one I created.
Can I update a feature in my own FeatureTable instance with the feature from MapView.identifyLayer?
Is there a way to get a feature's full data in a single request AND be able to edit it
Thank you Lucas, good to know that it's the same instance of FeatureTable.
As for identify, when you say "identify()" do you mean any of the MapView.identifyLayer.. and MapView.identifyGraphics.. methods? I've tried identifyLayer() and identifyLayerWithMaxResults() and both of these are sending queries to the server with outFields=*, resulting in the full sized response containing all fields and all attributes. This can be seen in the attribute editing qml example. If you comment out "featureLayer.selectFeaturesWithQuery(params, Enums.SelectionModeNew);" then clicking on features just calls the identify method and you'll see it actually returns the full result. Is that the expected behavior?