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

History Manager - Not working.

Expand Messages
  • John Manoah Stephen
    Hi all - I followed the example given in http://developer.yahoo.com/yui/examples/history/history-tabview.html The output is surprising. It works in IE, but
    Message 1 of 2 , Mar 30, 2009
      Hi all - I followed the example given in http://developer.yahoo.com/yui/examples/history/history-tabview.html

      The output is surprising. It works in IE, but wouldn't let me click any button within the tab. If I did, it would take me to tab0. In FF it simply wouldn't work.

      FYI, I'm using Caridy's Bubbling Library dispatcher to fetch the content inside my tabs.

      This is my peice of code. Any help is highly appreciated. TIA

      var tabView;
      var bookmarkedTabViewState = YAHOO.util.History.getBookmarkedState("tabview");
      var initialTabViewState = bookmarkedTabViewState || "tab0";
      var strLoadingContent = '<div align="center"><br/><br/><br/><img src="css/images/loading.gif" /> <br/>loading...</div>';

      function initTabView () {
      // Instantiate the TabView control...
      tabView = new YAHOO.widget.TabView("holder");
      YAHOO.plugin.Dispatcher.delegate(new YAHOO.widget.Tab({
      label: 'Dashboard',
      content: strLoadingContent,
      dataSrc: 'Dashboard.cfm',
      cacheData: false, active: true
      }),tabView)

      YAHOO.plugin.Dispatcher.delegate(new YAHOO.widget.Tab({
      label: 'Docs',
      content: strLoadingContent,
      dataSrc: 'Docs.cfm',
      cacheData: false
      }),tabView)

      YAHOO.plugin.Dispatcher.delegate(new YAHOO.widget.Tab({
      label: 'Archives',
      content: strLoadingContent,
      dataSrc: 'Archives.cfm',
      cacheData: false
      }),tabView)


      tabView.appendTo('holder');
      tabView.addListener("activeTabChange", handleTabViewActiveTabChange);

      }

      YAHOO.util.History.onReady(function () {
      var currentState;
      initTabView();
      currentState = YAHOO.util.History.getCurrentState("tabview");
      tabView.set("activeIndex", currentState.substr(3));
      });

      YAHOO.util.History.register("tabview", initialTabViewState, function (state) {
      tabView.set("activeIndex", state.substr(3));
      });

      function handleTabViewActiveTabChange (e) {
      var newState, currentState;

      newState = "tab" + this.getTabIndex(e.newValue);

      try {
      currentState = YAHOO.util.History.getCurrentState("tabview");
      if (newState != currentState) {
      YAHOO.util.History.navigate("tabview", newState);
      }
      } catch (e) {
      tabView.set("activeIndex", newState.substr(3));
      }
      }

      // Initialize the browser history management library.
      try {
      YAHOO.util.History.initialize("yui-history-field", "yui-history-iframe");
      } catch (e) {
      initTabView();
      }
    • John Manoah Stephen
      ... Could anyone help me in this regard? thanks!
      Message 2 of 2 , Apr 2, 2009
        --- In ydn-javascript@yahoogroups.com, "John Manoah Stephen" <johnmanoahs@...> wrote:
        >
        > Hi all - I followed the example given in http://developer.yahoo.com/yui/examples/history/history-tabview.html
        >
        > The output is surprising. It works in IE, but wouldn't let me click any button within the tab. If I did, it would take me to tab0. In FF it simply wouldn't work.
        >
        > FYI, I'm using Caridy's Bubbling Library dispatcher to fetch the content inside my tabs.
        >
        > This is my peice of code. Any help is highly appreciated. TIA
        >
        > var tabView;
        > var bookmarkedTabViewState = YAHOO.util.History.getBookmarkedState("tabview");
        > var initialTabViewState = bookmarkedTabViewState || "tab0";
        > var strLoadingContent = '<div align="center"><br/><br/><br/><img src="css/images/loading.gif" /> <br/>loading...</div>';
        >
        > function initTabView () {
        > // Instantiate the TabView control...
        > tabView = new YAHOO.widget.TabView("holder");
        > YAHOO.plugin.Dispatcher.delegate(new YAHOO.widget.Tab({
        > label: 'Dashboard',
        > content: strLoadingContent,
        > dataSrc: 'Dashboard.cfm',
        > cacheData: false, active: true
        > }),tabView)
        >
        > YAHOO.plugin.Dispatcher.delegate(new YAHOO.widget.Tab({
        > label: 'Docs',
        > content: strLoadingContent,
        > dataSrc: 'Docs.cfm',
        > cacheData: false
        > }),tabView)
        >
        > YAHOO.plugin.Dispatcher.delegate(new YAHOO.widget.Tab({
        > label: 'Archives',
        > content: strLoadingContent,
        > dataSrc: 'Archives.cfm',
        > cacheData: false
        > }),tabView)
        >
        >
        > tabView.appendTo('holder');
        > tabView.addListener("activeTabChange", handleTabViewActiveTabChange);
        >
        > }
        >
        > YAHOO.util.History.onReady(function () {
        > var currentState;
        > initTabView();
        > currentState = YAHOO.util.History.getCurrentState("tabview");
        > tabView.set("activeIndex", currentState.substr(3));
        > });
        >
        > YAHOO.util.History.register("tabview", initialTabViewState, function (state) {
        > tabView.set("activeIndex", state.substr(3));
        > });
        >
        > function handleTabViewActiveTabChange (e) {
        > var newState, currentState;
        >
        > newState = "tab" + this.getTabIndex(e.newValue);
        >
        > try {
        > currentState = YAHOO.util.History.getCurrentState("tabview");
        > if (newState != currentState) {
        > YAHOO.util.History.navigate("tabview", newState);
        > }
        > } catch (e) {
        > tabView.set("activeIndex", newState.substr(3));
        > }
        > }
        >
        > // Initialize the browser history management library.
        > try {
        > YAHOO.util.History.initialize("yui-history-field", "yui-history-iframe");
        > } catch (e) {
        > initTabView();
        > }
        >

        Could anyone help me in this regard?

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