none
Unable to get property 'style' of undefined or null reference

    Question

  • I sometimes get this error when traversing many times on ListView. How to fix it?


    Exception was thrown but not handled in user code at line 22600, column 25 in ms-appx://microsoft.winjs.1.0.rc/js/ui.js

    0x800a138f - JavaScript runtime error: Unable to get property 'style' of undefined or null referenceIf there is a handler for this exception, the program may be safely continued.

    Monday, September 03, 2012 4:17 AM

All replies

  • HI

    Can you give more details about how to repro this error?

    Actually we need a simple project to repro this error in local and then give you further suggestion.

    And I suggest you intergrade your application to RTM first, then try again.

    • Marked as answer by Dino He Wednesday, September 19, 2012 9:46 AM
    • Unmarked as answer by Dino He Monday, November 12, 2012 1:36 AM
    Tuesday, September 04, 2012 3:08 AM
  • Are you using the RTM version?

    There was a known problem before RTM!


    Jeff Sanders (MSFT)

    Tuesday, September 04, 2012 7:47 PM
    Moderator
  • Hi

    I'm on RTM and I'm experiencing a similar issue when I try to render the control.

    Code snippet:

                var templateElement = document.getElementById("itemTemplate");
                var targetElement = document.getElementById("itemBody");
                WinJS.Utilities.empty(targetElement);
                var list = ViewModel.UserData.getItems();
                for (var i = 0; i < list.length; i++) {
                    templateElement.winControl.render(list.getAt(i), targetElement);
                }
    The error message is: JavaScript runtime error: Unable to get property 'render' of undefined or null reference.
    Friday, November 09, 2012 1:00 PM
  • Ensure WinJS.processAll() has been called before this code.  Remember it is a process so you would want to ensure you do this within the .done() callback

    Jeff Sanders (MSFT)

    Monday, November 12, 2012 1:18 PM
    Moderator
  • Hi

    I get a similar error when I coded the Windows Blog Reader from Getting Started Guide to develop Windows 8 apps.

    When viewing the sites in the DetailPage I get an error "unable to get property 'length' of undefined or null reference".

    How can I resolve it ?

    Thanks for helping.

    Thursday, November 15, 2012 8:18 PM