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

Re: flushing/reloading tabview cache data?

Expand Messages
  • Caridy Patiño Mayea
    Hello, I don t understand your point of view: 1. The dispatcher uses the TabView s cache mechanism, so in theory we don t need to modify the dispatcher. Ok? 2.
    Message 1 of 4 , Feb 1, 2008
    • 0 Attachment
      Hello,

      I don't understand your point of view:

      1. The dispatcher uses the TabView's cache mechanism, so in theory we
      don't need to modify the dispatcher. Ok?

      2. How you will change your DATABASE? thru the same page? Maybe in
      other tab? If you're using another interface to change the content you
      can't notify to everybody who is surfing in your page that a certain
      content changed.

      3. You can change the tab cache attribute dynamically, or just change
      the data source (or maybe adding a timestamp as a URI parameter)

      Best Regards,
      Caridy Patiño (caridy at gmail.com)
      http://www.bubbling-library.com/

      --- In ydn-javascript@yahoogroups.com, "j.elventails"
      <j.elventails@...> wrote:
      >
      > Hi!
      >
      > I'm loading dynamic data sources into tabview
      > using Dispatcher from the bubbling library
      > (http://www.bubbling-library.com/)
      >
      > it looks something like this:
      >
      > YAHOO.util.Dispatcher.delegate (new YAHOO.widget.Tab({
      > label: 'Profile',
      > dataSrc: './data.php5?id=42',
      > cacheData: true,
      > active:true
      > }), tabView);
      >
      > The dynamic data I read-in is fetched from a database and doesn't
      > change often. But it can get updated, although rarely.
      >
      > So the issue is that each time I move from one tab to the other,
      > tabview reloads the tab (which I don't want, it takes too much time,
      > redraws everything inside the tab though nothing changed) - so I'm
      > using "cacheData: true" to avoid reloading the tab.
      >
      > Is there a way to tell tabview that its cache has expired?
      >
      > That way once e.g. the data has changed, tabview can be told
      > flush/reload its cache?
      >
      > Any suggestions appreciated,
      >
      > Thanks,
      >
    • j.elventails
      ... Thanks for you reply Caridy! ... we don t need to modify the dispatcher. Ok? Not sure, there might be no need to do anything with the dispatcher. ... you
      Message 2 of 4 , Feb 3, 2008
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, Caridy Patiño Mayea
        <caridy@...> wrote:
        >
        > Hello,
        >
        > I don't understand your point of view:
        >
        > 1. The dispatcher uses the TabView's cache mechanism, so in theory we
        > don't need to modify the dispatcher. Ok?
        >
        > 2. How you will change your DATABASE? thru the same page? Maybe in
        > other tab? If you're using another interface to change the content you
        > can't notify to everybody who is surfing in your page that a certain
        > content changed.
        >
        > 3. You can change the tab cache attribute dynamically, or just change
        > the data source (or maybe adding a timestamp as a URI parameter)
        >
        > Best Regards,
        > Caridy Patiño (caridy at gmail.com)
        > http://www.bubbling-library.com/
        >
        > --- In ydn-javascript@yahoogroups.com, "j.elventails"
        > <j.elventails@> wrote:
        > >
        > > Hi!
        > >
        > > I'm loading dynamic data sources into tabview
        > > using Dispatcher from the bubbling library
        > > (http://www.bubbling-library.com/)
        > >
        > > it looks something like this:
        > >
        > > YAHOO.util.Dispatcher.delegate (new YAHOO.widget.Tab({
        > > label: 'Profile',
        > > dataSrc: './data.php5?id=42',
        > > cacheData: true,
        > > active:true
        > > }), tabView);
        > >
        > > The dynamic data I read-in is fetched from a database and doesn't
        > > change often. But it can get updated, although rarely.
        > >
        > > So the issue is that each time I move from one tab to the other,
        > > tabview reloads the tab (which I don't want, it takes too much time,
        > > redraws everything inside the tab though nothing changed) - so I'm
        > > using "cacheData: true" to avoid reloading the tab.
        > >
        > > Is there a way to tell tabview that its cache has expired?
        > >
        > > That way once e.g. the data has changed, tabview can be told
        > > flush/reload its cache?
        > >
        > > Any suggestions appreciated,
        > >
        > > Thanks,
        > >
        >

        Thanks for you reply Caridy!

        > 1. The dispatcher uses the TabView's cache mechanism, so in theory
        we don't need to modify the dispatcher. Ok?

        Not sure, there might be no need to do anything with the dispatcher.

        > 2. How you will change your DATABASE? thru the same page? Maybe in
        > other tab? If you're using another interface to change the content
        you can't notify to everybody who is surfing in your page that a
        certain content changed.

        The change is coming from another interface indeed. Still I'd like to
        propagate the change (that happens rarely) to the cache tab, by e.g.
        flushing its cache <-- maybe I shouldn't use a cached tab at all! just
        wondering if that can be done, since caching helps!

        > 3. You can change the tab cache attribute dynamically, or just
        change the data source (or maybe adding a timestamp as a URI parameter)

        Can you tell me more about that - I couldn't easily find something
        related to changed the cache attributes - did you mean just setting
        true to false for cachedata? and what about adding a timestamp to the
        URI, do you have an example?


        My question is:
        you have a cached tabview, is there a way to clear the cache or flush
        its cache or reload it from javascript?

        Any suggestions on how to do that, how the caching works, or why its
        not a good idea are much appreciated as I'm still discovering how this
        (really cool) stuff works.

        Thanks!
      • Caridy Patiño Mayea
        Hello, Sorry for the delay... (too many to-do this days) Here is an example of auto-reload the tab s content (if the tab have cache=false) var tab =
        Message 3 of 4 , Feb 4, 2008
        • 0 Attachment
          Hello,

          Sorry for the delay... (too many to-do this days)

          Here is an example of auto-reload the tab's content (if the tab have
          cache=false)

          var tab = tabView.getTab(0),
          seg = 30,
          autoRefHandle = window.setInterval(
          function(){
          if (tabView.get('activeTab') === tab) {
          tab.set ('contentVisible', true);
          }
          },
          seg * 1000
          );

          If you want to change the cache policy on demand for a certain tab,
          you just need to change the attribute:
          tab.set ('cacheData', false); // disable cache
          tab.set ('cacheData', true); // enable cache

          If your admin interface is independent, as you mention before, a
          possible solution is to implement your own routine for loading the
          tab's content and insert it manually using:
          tab.set('content', '<p>Updated tab content.</p>';

          In this case I will recommend you to use the dispatcher (using the
          fetch routine instead of delegate).

          Best Regards,
          Caridy Patiño (caridy at gmail.com)
          http://www.bubbling-library.com/

          --- In ydn-javascript@yahoogroups.com, "j.elventails"
          <j.elventails@...> wrote:
          >
          > --- In ydn-javascript@yahoogroups.com, Caridy Patiño Mayea
          > <caridy@> wrote:
          > >
          > > Hello,
          > >
          > > I don't understand your point of view:
          > >
          > > 1. The dispatcher uses the TabView's cache mechanism, so in theory we
          > > don't need to modify the dispatcher. Ok?
          > >
          > > 2. How you will change your DATABASE? thru the same page? Maybe in
          > > other tab? If you're using another interface to change the content you
          > > can't notify to everybody who is surfing in your page that a certain
          > > content changed.
          > >
          > > 3. You can change the tab cache attribute dynamically, or just change
          > > the data source (or maybe adding a timestamp as a URI parameter)
          > >
          > > Best Regards,
          > > Caridy Patiño (caridy at gmail.com)
          > > http://www.bubbling-library.com/
          > >
          > > --- In ydn-javascript@yahoogroups.com, "j.elventails"
          > > <j.elventails@> wrote:
          > > >
          > > > Hi!
          > > >
          > > > I'm loading dynamic data sources into tabview
          > > > using Dispatcher from the bubbling library
          > > > (http://www.bubbling-library.com/)
          > > >
          > > > it looks something like this:
          > > >
          > > > YAHOO.util.Dispatcher.delegate (new YAHOO.widget.Tab({
          > > > label: 'Profile',
          > > > dataSrc: './data.php5?id=42',
          > > > cacheData: true,
          > > > active:true
          > > > }), tabView);
          > > >
          > > > The dynamic data I read-in is fetched from a database and doesn't
          > > > change often. But it can get updated, although rarely.
          > > >
          > > > So the issue is that each time I move from one tab to the other,
          > > > tabview reloads the tab (which I don't want, it takes too much time,
          > > > redraws everything inside the tab though nothing changed) - so I'm
          > > > using "cacheData: true" to avoid reloading the tab.
          > > >
          > > > Is there a way to tell tabview that its cache has expired?
          > > >
          > > > That way once e.g. the data has changed, tabview can be told
          > > > flush/reload its cache?
          > > >
          > > > Any suggestions appreciated,
          > > >
          > > > Thanks,
          > > >
          > >
          >
          > Thanks for you reply Caridy!
          >
          > > 1. The dispatcher uses the TabView's cache mechanism, so in theory
          > we don't need to modify the dispatcher. Ok?
          >
          > Not sure, there might be no need to do anything with the dispatcher.
          >
          > > 2. How you will change your DATABASE? thru the same page? Maybe in
          > > other tab? If you're using another interface to change the content
          > you can't notify to everybody who is surfing in your page that a
          > certain content changed.
          >
          > The change is coming from another interface indeed. Still I'd like to
          > propagate the change (that happens rarely) to the cache tab, by e.g.
          > flushing its cache <-- maybe I shouldn't use a cached tab at all! just
          > wondering if that can be done, since caching helps!
          >
          > > 3. You can change the tab cache attribute dynamically, or just
          > change the data source (or maybe adding a timestamp as a URI parameter)
          >
          > Can you tell me more about that - I couldn't easily find something
          > related to changed the cache attributes - did you mean just setting
          > true to false for cachedata? and what about adding a timestamp to the
          > URI, do you have an example?
          >
          >
          > My question is:
          > you have a cached tabview, is there a way to clear the cache or flush
          > its cache or reload it from javascript?
          >
          > Any suggestions on how to do that, how the caching works, or why its
          > not a good idea are much appreciated as I'm still discovering how this
          > (really cool) stuff works.
          >
          > Thanks!
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.