locked
LS HTML - Cannot save twice without refreshing in beetween RRS feed

  • Question

  • Hi,

    My users complain a lot about the fact that they cannot make several changes without refreshing the browser between each save. Indeed this not an expected behavior. Moreover, refreshing takes you to home page and hence the user has to navigate back to the page he was editing.

    Is this a know issue or should I post it as a bug? I could only find an old post on the subject without any answer.

    Tks a lot.

    Friday, September 27, 2013 3:53 PM

Answers

  • As a good workaround of my issue (I still wait for a solution from ms connect lol) I found that post:

    http://markgstacey.net/2013/05/09/using-sql-server-defaults-with-lightswitch/

    I use the created function at the end of that post in each and every AddEdit screen. I slightly modified it to get ride of the return as you may want to do other stuff in your function. It now look like this.

    myapp.AddEditBien.created = function (screen) {
        var LSTable = screen.Bien;
        if (LSTable.details.entityState == msls.EntityState.unchanged) {
            var TableID = LSTable.id;
            var dataWorkspace = new myapp.DataWorkspace();
            dataWorkspace.Tablette.Biens_SingleOrDefault(TableID).execute().then(function (result) {
                var serverLSTable = result.results[0];
                if (serverLSTable) {
                    LSTable.details._ = serverLSTable.details._;
                    LSTable.details.properties.all().forEach(function (prop) {
                        if (prop instanceof msls.Entity.Details.StorageProperty) {
                            prop.dispatchChange("value");
                            LSTable.dispatchChange(prop.name);
                        }
                    });
                }
            }, function (error) {
                msls.showMessageBox(error, { title: "Refresh failed" });
            });
        }
        //other stuff to do in the created function if needed
    };

    • Marked as answer by francois.m Thursday, October 17, 2013 8:35 AM
    Thursday, October 17, 2013 8:35 AM

All replies

  • Even stranger.

    On my viewEntity screen, I click on an edit button that takes me to an editEntity screen. I make two changes and save. I'm then back on my viewEntity screen and guess what ,I can only see one of my two changes. I click back on edit to check and yes I can see my two changes. I don't save as I know I'll have the issue mentioned in the first post so I cancel the edition. And then I'm back on the viewEntity screen with only one change... Of course when I refresh the browser I see my two changes. 

    Something goes wrong here.

    Friday, September 27, 2013 4:08 PM
  • Hi francois

    Thanks for raising this issue to us through Lightswitch forum.

    I’m sorry for hearing your frustration on this issue. I think you could consider submitting this issue to Microsoft connect site(http://connect.microsoft.com/ ), Microsoft engineers will reproduce this issue according to the proof you provide, and  evaluate this issue seriously, then they will give quick and positive response for you  there.           

    Best regards            


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Angie Xu Tuesday, October 1, 2013 7:47 AM
    • Marked as answer by francois.m Thursday, October 3, 2013 6:41 AM
    • Unmarked as answer by francois.m Thursday, October 17, 2013 8:35 AM
    Tuesday, October 1, 2013 7:47 AM
  • Tks for the answer.

    Unfortunately I cannot post in MS connect. I enter my bug, it says "Please wait" for a long time and then goes back to the form without any error message or success message either. Where do I sumbit a bug about the bug submission? ;-)

    Tuesday, October 1, 2013 10:09 AM
  • Hi francois

    Thanks for your feedback.

    We actively monitor forum conversations in an effort to receive feedback that helps us continually improve our products, so we have logged this feedback accordingly.

    In addition, you can also have a try submit this issue to Microsoft Connect site again, and check whether it has same issue.

    Best regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, October 3, 2013 2:10 AM
  • Tks, the bug submission went through this morning.
    I'll mark your reply as answer to close the post until the bug is looked after.

    Thursday, October 3, 2013 6:41 AM
  • As a good workaround of my issue (I still wait for a solution from ms connect lol) I found that post:

    http://markgstacey.net/2013/05/09/using-sql-server-defaults-with-lightswitch/

    I use the created function at the end of that post in each and every AddEdit screen. I slightly modified it to get ride of the return as you may want to do other stuff in your function. It now look like this.

    myapp.AddEditBien.created = function (screen) {
        var LSTable = screen.Bien;
        if (LSTable.details.entityState == msls.EntityState.unchanged) {
            var TableID = LSTable.id;
            var dataWorkspace = new myapp.DataWorkspace();
            dataWorkspace.Tablette.Biens_SingleOrDefault(TableID).execute().then(function (result) {
                var serverLSTable = result.results[0];
                if (serverLSTable) {
                    LSTable.details._ = serverLSTable.details._;
                    LSTable.details.properties.all().forEach(function (prop) {
                        if (prop instanceof msls.Entity.Details.StorageProperty) {
                            prop.dispatchChange("value");
                            LSTable.dispatchChange(prop.name);
                        }
                    });
                }
            }, function (error) {
                msls.showMessageBox(error, { title: "Refresh failed" });
            });
        }
        //other stuff to do in the created function if needed
    };

    • Marked as answer by francois.m Thursday, October 17, 2013 8:35 AM
    Thursday, October 17, 2013 8:35 AM
  • Haha, awesome to find the answer to another question of mine referring back to my own blog!
    Thursday, January 30, 2014 8:01 PM