Local Feature attribute editing java 10.2.4

1102
4
Jump to solution
12-15-2016 08:38 AM
thomasbales
Occasional Contributor

The java 10.2.4 SDK has an excellent sample on how to edit features from a online feature service but I have not been able to do the same on a local feature from a .geodatabase. The trouble I run into is creating a graphics layer from the local feature. I can get the hit test to work but not any kind of attribute editing. The goal is to edit a local layer and then have it sync up to the cloud. Because of the areas where this application is running, I had to develop the application to be "offline first" and much of the example code is the opposite, but I am slowly and shurely getting there.

Any ideas or direction?

I have added a simple code file. If you change the geodatabase path the code should render the 0 layer. The line I am having a problem with is:

//contentPanel.setFeature(damageLayer, (GeodatabaseFeatureTable) damageLayer.getFeatureTable(), hitFeature);

More specifically, the setFeature method has an error when I put the hit feature argument in. What is wrong?

0 Kudos
1 Solution

Accepted Solutions
thomasbales
Occasional Contributor

Adam, I am not sure exactly what was wrong but this link http://www.esri.com/videos/watch?videoid=4416&channelid=LegacyVideo&isLegacy=true&title=arcgis-runti... explained most the offline to offline patterns and using the demo code I was able to get everything I needed to work including the sync on one of my secure AGOL layers.

Again, thanks.

View solution in original post

0 Kudos
4 Replies
nita14
by
Regular Contributor

Tom,

Why don't you examine and implement these samples: Offline editing workflow | ArcGIS for Developers and Feature attribute editing | ArcGIS for Developers   ?

thomasbales
Occasional Contributor

Thanks, I will try and programmatically modify a local attribute today and see where it goes.

thomasbales
Occasional Contributor

I know where I am getting hung up. Looking at Editing using a toolkit there is a reference to using the PopupView on a geodatabase layer. However, I don't know when feature is at the end of the setFeature method. Using PopupView was a no brainer for an online ArcGISFeatureLayer, but I have been banging my head for days on how to edit a local layer when I start in a disconnected environment.

So what is feature? This has to something simple that I am missing. The solution is to create this pop up on a local layer.

// for a FeatureLayer
PopupView contentPanel = PopupView.createEditView("Edit Attributes", featureLayer);
// set layer, geodatabase feature table, and feature - edits take place on the feature table
contentPanel.setFeature(featureLayer, (GeodatabaseFeatureTable) featureLayer.getFeatureTable(), feature);

0 Kudos
thomasbales
Occasional Contributor

Adam, I am not sure exactly what was wrong but this link http://www.esri.com/videos/watch?videoid=4416&channelid=LegacyVideo&isLegacy=true&title=arcgis-runti... explained most the offline to offline patterns and using the demo code I was able to get everything I needed to work including the sync on one of my secure AGOL layers.

Again, thanks.

0 Kudos