dhtmlxTabbar contents

I have a Tabbar built from an XML source, and within each tab I have several contents that contains link to different pages; the XML data is pushed from the server via CDATA contents.



My question is when I move from TAB to TAB, it shows me the correct contents consisting of the LINKs that I populate from the XML, but the problem is the page shown underneath the TABBAR stays the same (I did NOT use iframe). I have included the same TABBAR to all of my pages and use it as a navigation.



My questions:



1) Is there a way that I when I click on the individual TAB, it would also trigger my first link contained in that TAB.

2) If I use setOnSelectHandler(), it does NOT show any of my contents, why?



Thanks.



Is there a way that I when I click on the individual TAB

You can use setOnSelectHandler in next manner

tabbar.setOnSelectHandler(function(){
    var link=tabbar._conZone.getElementsByTagName(“A”)[0].getAttribute(“href”); //get first link on page
    document.location.href=link;
    return true;
});


>>If I use setOnSelectHandler(), it does NOT show any of my contents, why?

The result which you returns from onSelect handler affect further processing

return true - allow active tab changing
return false or not return at all - event will be blocked ( tab will not be changed )


Thanks for the quick response, BUT this will always link me to the current TAB’s 1st link. How can I access the NEW TAB 1st link? that would really help. 



THANKS. 

how can I access the NEW TAB 1st link? that would really help.
You can use setOnSelectHandler in next manner

tabbar.setOnSelectHandler(function(id){
    var link=tabbar._content[id].getElementsByTagName(“A”)[0].getAttribute(“href”); //get first link on page
    document.location.href=link;
    return true;
});

This will work for statically tabbars, in case of tabbars the same approach can be used but with setOnTabContentLoaded method, which allow to set function which will be activated after data dynamically loaded to tab.

Thank you - it works great.