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

Tabview cacheData doesn't take effect immediately

Expand Messages
  • Scott Lerman
    If you activate a tab (by clicking the link) before the tab has finished loading, the tabview tries to load the tab from the server again, resulting in two
    Message 1 of 8 , May 1, 2007
    • 0 Attachment
      If you activate a tab (by clicking the link) before the tab has
      finished loading, the tabview tries to load the tab from the server
      again, resulting in two concurrent requests to the server. This is
      causing problems on my page when the contentChange event fires twice.
      Would this be considered a bug in the tabview, or should I come up
      with my own workaround for the behavior?
    • Scott Lerman
      ... Anyone have any opinions on this, or should I just go ahead and report it as a bug?
      Message 2 of 8 , May 3, 2007
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "Scott Lerman" <slerman@...> wrote:
        >
        > If you activate a tab (by clicking the link) before the tab has
        > finished loading, the tabview tries to load the tab from the server
        > again, resulting in two concurrent requests to the server. This is
        > causing problems on my page when the contentChange event fires twice.
        > Would this be considered a bug in the tabview, or should I come up
        > with my own workaround for the behavior?
        >

        Anyone have any opinions on this, or should I just go ahead and report
        it as a bug?
      • Nick Fitzsimons
        ... Do you have a test case we can look at? I know that several times as I ve been coming to grips with YUI I ve been led to suspect that I ve found a bug, but
        Message 3 of 8 , May 3, 2007
        • 0 Attachment
          On 3 May 2007, at 13:49:31, Scott Lerman wrote:

          > --- In ydn-javascript@yahoogroups.com, "Scott Lerman" <slerman@...>
          > wrote:
          >>
          >> If you activate a tab (by clicking the link) before the tab has
          >> finished loading, the tabview tries to load the tab from the server
          >> again, resulting in two concurrent requests to the server. This is
          >> causing problems on my page when the contentChange event fires twice.
          >> Would this be considered a bug in the tabview, or should I come up
          >> with my own workaround for the behavior?
          >>
          >
          > Anyone have any opinions on this, or should I just go ahead and report
          > it as a bug?

          Do you have a test case we can look at? I know that several times as
          I've been coming to grips with YUI I've been led to suspect that I've
          found a bug, but ultimately found out that I was just doing things
          wrong, even though my initial approach made sense to me at the time
          (and didn't conflict with anything from the documentation). Having a
          simple demonstration that exhibits the problem would make it easier
          to decide if it's worth filing a report.

          (Also, if it turns out that you've fallen into the same kind of trap
          as I sometimes have, it would then be worthwhile filing a bug against
          the documentation, so it can be made clearer.)

          Regards,

          Nick.
          --
          Nick Fitzsimons
          http://www.nickfitz.co.uk/
        • Eric Miraglia
          ... Nick (and everyone), When you find areas like this in the docs, please consider filing a bug against it. Having features that aren t accessible because
          Message 4 of 8 , May 3, 2007
          • 0 Attachment
            On May 3, 2007, at 6:35 AM, Nick Fitzsimons wrote:

            I've been coming to grips with YUI I've been led to suspect that I've
            found a bug, but ultimately found out that I was just doing things
            wrong, even though my initial approach made sense to me at the time
            (and didn't conflict with anything from the documentation).

            Nick (and everyone),

            When you find areas like this in the docs, please consider filing a bug against it.  Having features that aren't accessible because they're poorly documented (or incorrectly documented) is bad all the way around.  We've worked hard to document YUI well, but we know documentation is always a journey and never a destination.

            I saw something just like you describe the other day when trying to help someone out with a Dialog issue, and I was amazed that I hadn't caught that before as a lacuna in the docs...  But in some cases we've read the documentation so many times, it's hard for us to see what's missing from a fresh perspective.

            Regards,
            Eric



            ______________________________________________
            Eric Miraglia
            Yahoo! User Interface Library



          • Scott Lerman
            ... Here s a pretty simple test case.
            Message 5 of 8 , May 7, 2007
            • 0 Attachment
              --- 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>
              <script 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>
                    </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
              Comments anyone?
              Message 6 of 8 , May 11, 2007
              • 0 Attachment
                Comments anyone?
              • 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 7 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 8 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.