locked
updating screen data of a LightSwitch Screen RRS feed

  • Question

  • Hi,

    I am new to LightSwitch and I am using it to develope an HTML application.
    My task: 

    I have stilling Wells displayed on a screen. On item tap at a stilling well.. the user navigates forwards to the details screen of that particular stilling well. Every stilling well have a unique ID in the database and is passed successfully to the details screen and based on that ID all the records are shown. I want to change the displayName of two columns for a specific stilling well on my details screen. I am doing it in this way: 

    myapp.Observation.created = function  (screen) {

        // Write code here.
        alert("Created method");
        if (screen.tblStillingWellInstrument_FK == 3028) {
            alert("Entered IF part");
            screen.findContentItem("CalcWaterElev1").displayName = 'Calc Slurry Depth (ft.)';
            screen.findContentItem("WaterTemp1").displayName = 'Motor State';
        }

        else {
            alert("Entered else part");
            screen.findContentItem("CalcWaterElev1").displayName = 'Calc Water Elevation (ft.)';
            screen.findContentItem("WaterTemp1").displayName = 'Water Temp';
        }

    }; 

    Problem: 

    The code works fine. But when i navigate back and select another stilling well whose Id is not equal to 3028. The code enters the else part in the created method but the displayName of the column on the screen remains the old ones. The records displayed in details screen is based upon a view and i have tried using:

    screen.myView.refresh();

    screen.myView.load();

    Upon forced refresh of page on browser. The screen shows the correct updated displayNames of Columns. Any help would be appreciated.


    • Edited by w_billa Thursday, March 9, 2017 3:06 PM
    • Moved by CoolDadTx Thursday, March 9, 2017 3:09 PM Lightswitch related
    Thursday, March 9, 2017 3:03 PM

All replies

  • Please be aware that LightSwitch is no longer supported for new development. If you have an existing application written in LS then support will be provided through 2020 when VS 2015 ends support.

    I would strongly recommend that you look into using a different technology such as WPF or MVC depending upon your needs.

    Thursday, March 9, 2017 3:11 PM