Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1840
Navigate to tab in JavaScript not work in Firefox or Safari
posted

Hello,

i use a Page with a  with following tab control (Version 10.2 Clr4.0

<ig:WebTab ID="WebTab1" runat="server" Height="700px"  Width="100%"
            ScrollButtons-AutoHide="False" meta:resourcekey="WebTab1Resource1">
    <tabs>
        <ig:ContentTabItem runat="server" Text="Druckversion" AutoSize="True"
            meta:resourcekey="ContentTabItemResource1">
        <Template>
            <iframe src="Detail_Print.aspx"  height="800px" width="100%" id="ifrm_Detail_Print"></iframe>
        </Template>
        </ig:ContentTabItem>
        <ig:ContentTabItem runat="server" Text="Adressen" AutoSize="True"
            meta:resourcekey="ContentTabItemResource2">
         <Template>
            <iframe src="Adresse.aspx" height="800px" width="100%" id="ifrm_Adresse"></iframe>
        </Template>
        </ig:ContentTabItem>
        <ig:ContentTabItem runat="server" AutoSize="True" Text="Tarife"
            meta:resourcekey="ContentTabItemResource3">
        <Template>
            <iframe src="Tarif.aspx" height="600px" width="100%" id="ifrm_Tarif"></iframe>
        </Template>
    </tabs>

<ScrollButtons AutoHide="False"></ScrollButtons>
</ig:WebTab>

On the first page i use an ImageButton to navigate to an ohter tab. The JavaScript Code is:

               var WTab = null;

               function WIB_Change_Adr_Click(obj, args) {
                   if (WTab == null) {
                       WTab = parent.$IG.WebTab.find("MainContent_WebTab1");
                   }
                   if (WTab != null) {
                       WTab.set_selectedIndex('1', true, e);
                       WTab.set_activeIndex(1);
                   }

               }

In IE the navigation to Tab 1 works well, in other browsers nothing happens (not even a js-error).

Any knowledge what went wrong?

Parents
No Data
Reply
  • 24497
    posted

    Hi,

    I suggest you to use $find(id). I tested following within ContentUrl of tab and it worked in all browsers.

    function click1()
    {
     var win = parent;
     if(win && win.$find)
     {
      var tab = win.$find('WebTab1')
      if(tab)
       alert('selected tab:'+tab.get_selectedIndex());
      else
       alert('no tab');
     }
     else
      alert('no javascript in parent');
    }

    I expect that same codes will work if explicit iframe is used instead of ContentUrl

Children
No Data