locked
Windows 8 Metro Javascript - Navigation-Related Issue RRS feed

  • Question

  • Hello guys,

    I hope to receive some help from the community right here regarding an issue that has been bugging me for several weeks now!

    My current issue is that I previously developed my application in Consumer Preview and now that I have migrated to Release Preview, my application do face some breaks. However, I cannot find them under the documentation of the Migration Guide provided by Microsoft.

    My issue, technically is as follows:

    I have an extended-splash.html which runs for 5 seconds or so for now and it automatically redirects to home.html; which actually is loaded into a DIV ContentHost in Default.html as a control. The actual transition and all has no issues now. However, when I get to the intended home.html right now on the 1st load, the header, appbar and everything loads BUT my content for the body does not load (which is listview and gridviews). However, if I navigate to another page (let's say it is index.html) and then navigate backwards, everything magically appears!

    I am really frustrated by this issue and it has hindered my progressive development and I am hoping someone out there could help me with this issue! :( 

    Please and thank you in advance, friends!

    Monday, June 18, 2012 9:35 AM

Answers

All replies

  • Hi Eustace,

    Your problem seems unique to your project.  Can you provide a simple reproduction of the issue?

    -Jeff


    Jeff Sanders (MSFT)

    Monday, June 18, 2012 1:49 PM
    Moderator
  • Hi Eustace,

    Your problem seems unique to your project.  Can you provide a simple reproduction of the issue?

    -Jeff


    Jeff Sanders (MSFT)

    Hello Jeff,

    I am afraid that I am unable to reproduce such an issue. I have tried creating a new project in Release Preview and then importing the files from my Consumer Preview version over to the Release Preview version to ensure that there is no 'back end' holes, I would say. However, this issue persists all the way. Previously I have had the event listener of "viewstatechanged". However, following the migration documentation that Microsoft provided, I have now changed this to "window.onresize = this._viewstatechanged.bind(this)" which should no longer cause any issues.

    I really hope there are other ways that assistance could be provided. Thank you.

    Tuesday, June 19, 2012 1:00 AM
  • Hi Eustace,

    Your problem seems unique to your project.  Can you provide a simple reproduction of the issue?

    -Jeff


    Jeff Sanders (MSFT)

    Hi Jeff,

    I think I might have identified the reason why. On the first try of coming to home.html, my control (a listview), 

    lvAlbums.winControl <---- this returns nothing. Such as clientHeight (which I really need) is 0.

    Only when the 2nd time I come back to home.html, would the clientHeight attribute and other values appear accordingly. Would this narrow down the scope? Of why my "Listview" which is var albumControl = lvAlbums.winControl is empty?

    Thanks!

    Tuesday, June 19, 2012 4:08 AM
  • If needed, I would be able to send you my project (via a Dropbox link) for you to download and after which you could help me out?

    Thank you.

    Tuesday, June 19, 2012 4:58 AM
  • Hi Eustace,

    When are you calling: lvAlbums.winControl ?  You have to make sure you do this after the control has been created like after WinJS.UI.Process all.

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, June 19, 2012 11:51 AM
    Moderator
  • Hi Eustace,

    When are you calling: lvAlbums.winControl ?  You have to make sure you do this after the control has been created like after WinJS.UI.Process all.

    -Jeff


    Jeff Sanders (MSFT)

    Hi Jeff,

    Here is a snippet of my code:

    albumOverviewControl.itemDataSource = groupedAlbums.groups.dataSource;
    albumOverviewControl.itemTemplate = semanticZoomTemplate;

    albumControl.selection.clear();
    albumControl.itemDataSource = groupedAlbums.dataSource;
    albumControl.groupHeaderTemplate = listAlbumsHeaderTemplate;
    albumControl.groupDataSource = groupedAlbums.groups.dataSource;
    albumControl.itemTemplate = (type == "grid") ? function (itemPromise) {
    return itemPromise.then(function (item) {
    var result = document.createElement("div");
    result.className = "gridAlbum";

    var image = document.createElement("img");
    image.alt = item.data.title;
    image.src = item.data.items[0].thumbnail;

    var details = document.createElement("div");
    details.className = "details";
    details.innerHTML = "<h5>" + item.data.title + "</h5><h6>" + MyMemories.getMonthYear(item.data.date) + "</h6>";
    result.appendChild(image);
    result.appendChild(details);

    return result;
    });
    } : function (itemPromise) {
    return itemPromise.then(function (item) {
    var containerHeight = lvAlbums.clientHeight;
    var maxRows = Math.floor((containerHeight - 10 - 100) / 130);
    var pictures = item.data.items.slice(0);

    However, in my entire home.js there isn't a WinJS.UI.ProcessAll() method at all, in fact, many pages does not have that but they still run all right to me. 

    Thank you!

    Tuesday, June 19, 2012 1:02 PM
  • If you can share your project with me, that would be the easiest way to continue.

    You can contact me using http://blogs.msdn.com/jpsanders/contact.aspx

    -Jeff


    Jeff Sanders (MSFT)

    • Marked as answer by Dino He Tuesday, June 26, 2012 8:58 AM
    Wednesday, June 20, 2012 11:54 AM
    Moderator