We are seeing some strange behavior when calling tabbar.tabWindow(tab_id). When all the tabs are predefined in the xml file it returns the iframe handle.
But when we dynamically add a tab to the tabbar by calling addTab. Then calling tabWindow on the new tab it returns undefined/null. See the example code snippit below.
Here is an example xml document for a tabbar
<?xml version='1.0'?>
A1
A2
in our jsp
Thank you
Carmine Marino
Hello,
tabWindow method returns iframe object only when you use iframe-based modes: iframe, iframes and iframe-on-demand.
tabbar.setHrefMode(“iframes”)
tabbar.addTab(“a3”,“a3”,“100px”); // Add new tab dynamically…
tabbar.setContentHref(“a3”,href);
tabbar.tabWindow(‘a3’).name=“a3”;
You guys rock!
I’ll give this a try! thank you.
carmine
Thank you very much for your fast response. it’s working, but I noticed something a bit weird.
var tabbar=new dhtmlXTabBar(“a_tabbar”);
tabbar.setImagePath("/ims/scripts/dhtmlx/dhtmlxTabbar/codebase/imgs/");
//tabbar.loadXML(“test.xml”); // <<<<<<<<<<<<<<<< HERE If I uncomment this line I only see the two tabs "A1 and A2 that are defined in the xml document. I don’t see the REVIEW TAB
tabbar.setHrefMode(“iframes”);
tabbar.addTab(“REVIEW”,“REVIEW”,“100px”);
tabbar.setContentHref(“REVIEW”, “”);
tabbar.tabWindow(“REVIEW”).name=“REVIEW”;
Is it possbile to load from an xml file and then dynamically add new tabs? If I comment the loadXML call I see the REVIEW tab.
XML doc:
<?xml version='1.0'?><tabbar hrefmode=‘iframes-on-demand’>A1A2
Thank you.
carmine
Hello,
if you load tabbar from xml and add tab dynamically, addTab method should be called after xml loading and using setHrefMode isn’t necessary in this case:
var tabbar=new dhtmlXTabBar(“a_tabbar”);
tabbar.setImagePath("/ims/scripts/dhtmlx/dhtmlxTabbar/codebase/imgs/");
tabbar.loadXML(“test.xml”,onLoadingEnd)
function onLoadingEnd(){
tabbar.addTab(“REVIEW”,“REVIEW”,“100px”);
tabbar.setContentHref(“REVIEW”, “”);
tabbar.tabWindow(“REVIEW”).name=“REVIEW”;
});