Why doesn't applyEdits work after changing to AMD model from Legacy model

465
1
09-18-2013 09:00 AM
ThomasRoussell
New Contributor III
I am trying to convert code to the AMD model and in the following code the ApplyEdits method stops without generating any error message.
When I step through the code in the debugger, the line "var layer = updateFeature.getLayer();" functions properly but the line "if (originalFeature != null) never executes and no error message is generated.

                dojo.connect(saveButton, "onClick", function () {
                    check_attributes(updateFeature);
                    var today = new Date();
                    var dd = today.getDate();
                    var mm = today.getMonth() + 1;
                    var yyyy = today.getFullYear();
                    var today = String(yyyy) + '/' + String(mm) + '/' + String(dd);
                    updateFeature.attributes.Last_Modified_Date = today;
                    user_name = dom.byId("User_Name").innerHTML;
                    updateFeature.attributes.Last_Modified_By = user_name;

                    var layer = updateFeature.getLayer();

                    try {
                        layer.applyEdits(null, [updateFeature, ], null, function () {
                            if (originalFeature != null) {
                                try {
                                    var operation = new editingUpdate({
                                        featureLayer: layer,
                                        preUpdatedGraphics: [new Graphic(originalFeature)],
                                        postUpdatedGraphics: [updateFeature, ]
                                    });
                                    undoManager.add(operation);
                                    checkUI();
                                }
                                catch (err) {
                                    alert(err);
                                }
                            }
                        },
                        function (err) {
                            alert(err.message);
                        });
                    }
                    catch (err) {
                        alert(err.message);
                    }
                });
0 Kudos
1 Reply
ThomasRoussell
New Contributor III
ESRI's "Using the Attribute Inspector" Live Sample doesn't seem to work either.

Has anyone else noticed this?

TGR
0 Kudos