Customer Portal

Get Involved. Join the Conversation.

Topic

    Eric Rinehart
    "YAHOO.widget.Treeview.prototype" is null or not...Answered
    Topic posted December 21, 2011 by Eric RinehartRed Ribbon: 250+ Points, last edited January 25, 2012 
    921 Views, 8 Comments
    Title:
    "YAHOO.widget.Treeview.prototype" is null or not an object
    Content:

    Hi,

    I have a CP site that displays one of several pages in an iframe. The page in the iframe allows a user to submit feedback.

    Certain iframe pages throw an error when loading, and others don't. The error is "YAHOO.widget.Treeview.prototype" is null or not an object (see attached screen cap)

    I'm having a hard time figuring out why this error is being thrown, and why it only appears on certain pages. If I do "View Source" on the iframe page and compare the rendered html between a page that does throw the error and one that does not, I cannot find a difference that seems to relate to creation or use of the Treeview widget.

    This error only seems to happen in IE7. In Firefox or IE8, the pages all seem to work fine.

    I'm really stumped on this one. Can anyone give me any ideas about where to look to try to track this down?

    Thanks in advance & Merry Christmas!
    Eric

    Image:

    Best Comment

    Jeremy Watson

    Eric,

    That looks correct.  You might need to submit a customer care incident if there is still an issue.  They may be able to look at your site more closely and better diagnose what is going on.

    James

    Comment

     

    • Ernie Turner

      When viewing the source of the page, can you find a reference to the YUI treeview file? It should look something like this

          <script type='text/javascript' src='/rnt/rnw/yui_2.7/treeview/treeview-min.js'></script>

      Also, are the product/category widgets that you're using our standard widgets or have you customized them at all?

    • Eric Rinehart

      eturner,

      Thanks for your quick response.

      Yes, the reference to treeview is the last thing in the <body> element.

      The product/category widgets are the standard widgets, but they're in a hidden <div>, in case that makes a difference. We made a widget to put product/category and a few other items in a hidden <div> on each of the pages that appear in the iframe.

      I've found at times that if I get the treeview error, if I re-load the iframe page (maybe a couple times), the page will load without an error and then submit without an error. So does the treeview just take time to load, and won't work until it's ready?

      Thanks,
      Eric

    • Ernie Turner

      I'm guessing that might be the problem. We've had a litany of issues around IE and iframes. I believe the CP documentation has a specific fix for this situation that you might try. From the online documentation, go to 'Developer Guide->Working with iFrames'.

    • Eric Rinehart

      Just to be clear, that code goes in the pages (rather, their template) that appear within the iframe?

      Thanks!
      Eric

    • Jeremy Watson

      Correct, you modify the template file that is being loaded within the iframe.

      James

    • Eric Rinehart

      Hi. Thanks for the responses. Sorry for the delay getting back on this.

      I have modified the template file, but it doesn't seem to have helped the end users. I'm still getting feedback that the forms aren't submitting.

      This still works just fine for me, so I can't reproduce the error. Also, my IT dept has upgraded me to IE8, so it'll be harder to test in the same environment my users have. I can only hope that they get upgraded too. Sounds like that will help, if this is related to IE7 problems with iframes.

      I'd like to make sure that I've applied the fix correctly. Here is a chunk from the template for content that appears within the iframe:

        <body class="yui-skin-sam">
      <script type='text/javascript'>
      /* This helps IE 6 & 7 to use these pages */
      try {
      if(YAHOO.env.ua.ie > 0)
      {
      // override onDOMReady to use window.onload
      YAHOO.util.Event.onDOMReady = function( p_fn, p_obj, p_scope ){
      YAHOO.util.Event.addListener( window, "load", p_fn, p_obj, p_scope );
      };
      }
      } catch (e) {
      }
      </script>
      <!-- The content starts here -->

      Does that look right? Still trying to figure out what else I might try.

      Thanks again for your help!
      Eric

    • Jeremy Watson

      Eric,

      That looks correct.  You might need to submit a customer care incident if there is still an issue.  They may be able to look at your site more closely and better diagnose what is going on.

      James

    • Eric Rinehart

      Thanks James. Yep, it's still an issue. It just happened to me in IE8 (compatibility mode). I'll submit an incident. Thanks!