Remain in Edit Screen after attempting a save RRS feed

  • Question

  • Based on the data entered in an HTML edit screen, I have server side code that sometimes asks a user if they want to continue with their save. If the user clicks Cancel in a msgbox, I run "me.DataWorkspace.Dispose()" on the server side to prevent saving changes.

    The issue I am encountering is that after this server code is run, I want to remain in the HTML edit screen (without generating an error message, since the user already gave their permission to Cancel this transaction).

    The closest example I could find to controlling the client side save was:

    myapp.onssavechanges = function (e) {

    var promises = [];


    e.detail.promise = WinJS.Promise.join(promises);


    I then put ".then(null, function(fail){myapp.activeDataWorkspace.ApplicationData.details.discardChanges()}" after  saveChanges, however after the failed save, the edit screen was still closed. I then put this line of code after the WinJS promise line, but again, after the failed save, the edit screen was closed. Does anyone know of a way that I can stay in the edit screen, after a failed save?


    - Mike

    Tuesday, February 18, 2014 12:44 AM