locked
PageControlNavigator Refresh RRS feed

  • Question

  • Hello all!

    I'm building an application that allows users to interact with a web service. This service uses the OAuth authentication mechanism similar to other popular Web 2.0 services like Twitter. Anyway, I'm using the Windows.Security.Authentication.Web.WebAuthenticationBroker (which is AWESOME btw) to show the login page for this web site asynchronously in a modal window. Once the user enters their credentials, the site redirects back to my app and provides me with a token. I then have to stuff that token into a follow-up request that gets signed with my private key, which ultimately gets me the session key that I can use to make authenticated calls to this service.

    That part is working fine.

    The problem is that the home page of my Grid app has already rendered by the time I'm done getting the session key (and other info about the user). I want the home page of my Grid app to show the user information about THEIR account instead of a blank screen. I tried nav.navigate(Application.navigator.home, null) and this works, BUT it shows the user the "back" nav button, which doesn't make any sense and if clicked just brings you back to the exact same view you're already at. So really I want to refresh this page instead of navigating to it. I tried setting window.location to my default.html page but that caused absolutely nothing to be displayed.

    I would optimally like to asynchronously trigger a refresh once I'm done fetching the user's session key. I've tried looking through the documentation but haven't found anything useful. Anyone know what I could do here? I would really appreciate it :)

    Sunday, October 28, 2012 8:43 AM

Answers

  • Got it!

    For those who may be searching for this, I used 

    WinJS.UI.Pages.render(Application.navigator.home);
    when I was ready to refresh and it essentially just re-rendered the page, which is exactly what I was looking to do. Also, you can pass this whatever URI you want, I just used the shortcut for "home" that the navigator provides. Hope this helps someone! Drove me crazy for a while.
    • Marked as answer by trogdor3222 Sunday, October 28, 2012 4:40 PM
    Sunday, October 28, 2012 4:40 PM