Select to view content in your preferred language

Connect Info Window to Edit Widget

676
1
Jump to solution
01-22-2013 07:40 AM
MeleKoneya
Frequent Contributor
I am using the editorWidget to add new features,  delete features, and update features.     I am using the Attribute Inspector to display and edit the newly added features and selected features attributes.     

I recently added a function to my application which allows the user to search for an existing editable feature by a unique identifier (asset_id).   I am using the .selectFeatures() method on the FeatureLayer to select and then zoom to a feature based on the asset_id.

The attributes for the selected feature display within the attribute inspector with any associated domains and it appears that the fields are editable,  but my application errors when a change is made within the attribute inspector.  It appears that the attribute inspector is behaving like an info window and is not connected to the FeatureLayer for editing as I get an error which states.

Unhandled exception at line 19, column 158500 in http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/dijit/editing/Editor-all.js

'this._currentGraphic.attributes' is null or not an object

How can I connect the changes made via the attribute inspector in the above example back to the editor widget?

Thanks,

Mele
0 Kudos
1 Solution

Accepted Solutions
MeleKoneya
Frequent Contributor
What I ended up doing was setting the Editor Widget _currentGraphic property equal to the graphics (results) or my featureLayer.selectFeatures query.

featureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (results) { ZoomToFeature(results) });

setGraphicsAttributes(result);

function setGraphicsAttributes (graphic) {
                editorWidget._currentGraphic = graphic;

            }

View solution in original post

0 Kudos
1 Reply
MeleKoneya
Frequent Contributor
What I ended up doing was setting the Editor Widget _currentGraphic property equal to the graphics (results) or my featureLayer.selectFeatures query.

featureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (results) { ZoomToFeature(results) });

setGraphicsAttributes(result);

function setGraphicsAttributes (graphic) {
                editorWidget._currentGraphic = graphic;

            }
0 Kudos