locked
Refresh the page on settings flyout event

    Question

  • i am working with WinJS application. on change of some settings parameter i want to refresh the current screen. in detail, i am converting my web applilcation to a windows store app using WinJS. here i ve a settings flyout screen. on click on ok button in settings i want to refresh the existing page.

    Rassal

    Thursday, April 10, 2014 12:05 PM

All replies

  • Since you are using HTML5/JS you can just reload the data as you would when you retrieved it in the first place. I'm assuming that's an AJAX call or similar. There is no "refresh page" command or anything like that.

    Or if you are working on Navigation App ( you have the Navigation.JS) 

    you may use : 

    WinJS.Navigation.navigate("your-page-name-here.html");

    Thursday, April 10, 2014 4:37 PM
  • i've done that before. here the problem is innerHTML data is not showing for the second time.

    Rassal

    Thursday, April 10, 2014 4:40 PM
  • Could you paste your code here ? 

    Thursday, April 10, 2014 4:40 PM
  •  

    page 1

     if (xhr.status === 200) {
                        resultRecord = JSON.parse(xhr.responseText);
                        var jsonHtmlTable = ConvertJsonToTable(resultRecord, "tblId", "", null);
                        WinJS.Utilities.setInnerHTMLUnsafe(OutputData, jsonHtmlTable);

    settings page on click action

    WinJS.Navigation.navigate(WinJS.Navigation.location);


    Rassal

    Thursday, April 10, 2014 4:45 PM
  • I've seen a previous forum post or two describing navigation issues when reloading the same page. I'm not sure if the issue has been fixed. You might try this: instead of reloading the page, factor out page initialization code in ready() to a separate function. Then, when you want to refresh the page, call the refactored function instead of reloading the page using WinJS.Navigation.navigate().
    Thursday, April 17, 2014 7:28 PM
  • Hello,

       Are you using the windows 8.1 navigator.js? If you are having problems with the contents of your page not refreshing due to navigating back to the same page, this could be a result of the unload() firing before the ready() in the navigator.js. This problem was solved by using the navigator.js from the windows 8 navigator.js template. You can see how it was done in this forum post. 

    http://social.msdn.microsoft.com/Forums/windowsapps/en-US/d776d66b-1332-4a20-ac47-4e2e21f0f822/change-in-the-navigatorjs-functionality-in-81-use-80-navigatorjs-if-you-run-into-this-issue?forum=winappswithhtml5

    Thursday, April 17, 2014 8:42 PM