Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Re: Tabview cacheData doesn't take effect immediately

Expand Messages
  • Eric Miraglia
    Scott, I agree with you that this is not the correct behavior; TabView shouldn t be initiating another XHR transaction on the second click if the first one
    Message 1 of 8 , May 11, 2007
    • 0 Attachment
      Scott,

      I agree with you that this is not the correct behavior; TabView shouldn't be initiating another XHR transaction on the second click if the first one hasn't yet returned.

      After validating your repro case, I filed it as a bug in SourceForge which you can track here:


      Regards,
      Eric


      ______________________________________________
      Eric Miraglia
      Yahoo! User Interface Library


      On May 7, 2007, at 7:04 AM, Scott Lerman wrote:

      --- In ydn-javascript@yahoogroups.com, Nick Fitzsimons <nick@...> wrote:
      >
      > Do you have a test case we can look at?
      >
      > Regards,
      >
      > Nick.
      > --
      > Nick Fitzsimons
      > http://www.nickfitz.co.uk/

      Here's a pretty simple test case.

      <html>
      <head>
      <link rel="stylesheet" type="text/css" href="yui/build/
      tabview/assets/tabview.css">
      <link rel="stylesheet" type="text/css" href="yui/build/tabview/assets/border_tabs.css">

      <script type="text/javascript" src="yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
      <script type="text/javascript" src="yui/build/element/element-beta-min.js"></script>
      <script type="text/javascript" src="yui/build/connection/connection-min.js"></script>
      <scr! ipt type="text/javascript" src="yui/build/tabview/tabview-min.js"></script>
      <script type="text/javascript" src="yui/build/container/container-min.js"></script>

      <script type="text/javascript">
      function onLoad()
      {
        var tabview = new YAHOO.widget.TabView('demo_tabview');
        tabview.addListener('contentReady', tabviewReady, {tabview: tabview});
      }

      function tabviewReady(event, params)
      {
        params.tabview.getTab(0).set('dataSrc', 'tab.php');
        params.tabview.getTab(0).set('cacheData', true);
      }
      </script>

      </head>
      <body onload="onLoad();">
        <div id="demo_tabview" class="yui-navset" style="margin: 10px;">
          <ul class="yui-nav">
            <li>
              <a! ><em>Tab 1</em></a>
          &n bsp; </li>
            <li>
              <a><em>Tab 2</em></a>
            </li>
          </ul>
          <div class="yui-content">
            <div>
            </div>
            <div>
              Content for Tab 2
            </div>
          </div>
        </div>
      </body>
      </html>

      The source for tab.php is just

      <?php
      sleep(5);
      echo 'stuff';
      ?>


      If you click on Tab 1 again while it's still loading, it will request tab.php again (easiest to see it with Firebug's console).


    • Scott Lerman
      ... Great, thanks.
      Message 2 of 8 , May 15, 2007
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
        >
        > Scott,
        >
        > I agree with you that this is not the correct behavior; TabView
        > shouldn't be initiating another XHR transaction on the second click
        > if the first one hasn't yet returned.
        >
        > After validating your repro case, I filed it as a bug in SourceForge
        > which you can track here:
        >
        > http://sourceforge.net/tracker/index.php?
        > func=detail&aid=1717331&group_id=165715&atid=836476
        >
        > Regards,
        > Eric
        >
        >
        > ______________________________________________
        > Eric Miraglia
        > Yahoo! User Interface Library

        Great, thanks.
      Your message has been successfully submitted and would be delivered to recipients shortly.