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

issue with YAHOO.util.History.navigate

Expand Messages
  • dreamworker22000
    If I take history-tabview_clean.html and make the following changes I am getting unexpected behavior I was hoping someone colud explain. I change the li for
    Message 1 of 2 , Nov 29, 2008
    • 0 Attachment
      If I take history-tabview_clean.html and make the following changes I
      am getting unexpected behavior I was hoping someone colud explain.

      I change the li for tab3 and give it an id so that it begins in a
      hidden state :

      <li id="tab3LI" title="" class="" style="visibility:hidden"><a
      href="#tab3"><em>Tab Three Label</em></a></li>

      I add the following to the body section:
      <div id="selectTab">
      <a id="TabSelect" href="#" title="select Tab3" ><b>Select
      Tab3</b></a>
      </div>

      and this code to the script:

      YAHOO.util.Event.on('TabSelect', 'click', function (){
      YAHOO.util.Dom.setStyle('tab3LI', 'visibility', 'visible');
      YAHOO.util.History.navigate("tabview","tab2");
      });

      what happens is if I click the link Tab3 becomes visible and is
      briefly set active and recorded in the browser history but then
      immediately tab1 gets set as the active tab. If I hit the browser back
      button
      it does navigate to the previous state where tab 3 is selected

      so essentially what I am trying to accomplish is make tabs visible
      based on criteria and setting them as the active tab but it appears
      that doing tabView.set("activeIndex", 2); is not the same as
      actually clicking on the tab
      any help would be appreciated
    • dreamworker22000
      For what it s worth I can do a workaround but it disturbs me because its a workaround and I obviously don t understand how BHM is really working- if someone
      Message 2 of 2 , Nov 30, 2008
      • 0 Attachment
        For what it's worth I can do a workaround but it disturbs me because
        its a workaround and I obviously don't understand how BHM is really
        working- if someone could look at it and explain I'd reall appreciate it:

        by adding:
        window.setTimeout('history:back()',100);
        after
        YAHOO.util.History.navigate("tabview","tab2");

        anyplace I use a link to make a tab visible and set it active, it
        works the way I intend but I'd much rather understand a "proper" way
        or using tabView.set("activeIndex" or tabView.set("activeTab functions
        are treating differntly by BHM

        Thanks if you find time to look


        --- In ydn-javascript@yahoogroups.com, "dreamworker22000"
        <dreamworker22000@...> wrote:
        >
        > If I take history-tabview_clean.html and make the following changes I
        > am getting unexpected behavior I was hoping someone colud explain.
        >
        > I change the li for tab3 and give it an id so that it begins in a
        > hidden state :
        >
        > <li id="tab3LI" title="" class="" style="visibility:hidden"><a
        > href="#tab3"><em>Tab Three Label</em></a></li>
        >
        > I add the following to the body section:
        > <div id="selectTab">
        > <a id="TabSelect" href="#" title="select Tab3" ><b>Select
        > Tab3</b></a>
        > </div>
        >
        > and this code to the script:
        >
        > YAHOO.util.Event.on('TabSelect', 'click', function (){
        > YAHOO.util.Dom.setStyle('tab3LI', 'visibility', 'visible');
        > YAHOO.util.History.navigate("tabview","tab2");
        > });
        >
        > what happens is if I click the link Tab3 becomes visible and is
        > briefly set active and recorded in the browser history but then
        > immediately tab1 gets set as the active tab. If I hit the browser back
        > button
        > it does navigate to the previous state where tab 3 is selected
        >
        > so essentially what I am trying to accomplish is make tabs visible
        > based on criteria and setting them as the active tab but it appears
        > that doing tabView.set("activeIndex", 2); is not the same as
        > actually clicking on the tab
        > any help would be appreciated
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.