You are on page 1of 1

//create a corresponding ID

var tabId = "tab" + tabName;

//check whether the tab is already created


var tabElement = dojo.widget.byId(tabId);
if(!tabElement)
{
//If it is not there create it
tabParams = {id: tabId, label: tabName};
tab = dojo.widget.createWidget("ContentPane",
tabParams);

innerTabParams = {id: "inner_" + tabId,


style:"background:#FFFFFF;width:100%;height:100%;"};
innerContentPane =
dojo.widget.createWidget("ContentPane", innerTabParams);
tab.addChild(innerContentPane);

tabContainer = dojo.widget.byId("ribbonContainer");
tabContainer.addChild(tab);
}

innerContentPane = dojo.widget.byId("inner_" + tabId);

var subType =
oAllExternalTests[i].getAttribute("testtype").split('/')[1];
if(subType)
{
var newTabContainerElement = dojo.widget.byId("itc_"
+ tabId);
if(!newTabContainerElement)
{
newTabContainerParams = {id: "itc_" + tabId,
style:"background:#000000;width:100%;height:100%;"};
newTabContainer =
dojo.widget.createWidget("TabContainer", newTabContainerParams);
innerContentPane.addChild(newTabContainer);
}

newTabContainer = dojo.widget.byId("itc_" + tabId);

newTabParams = {id: "ntab" + subType, label: subType};


newTab = dojo.widget.createWidget("ContentPane",
newTabParams);

//Add some content to the new tab. We add a div

newTabContainer.addChild(newTab);
}else{

//Add some content directly to the content pane


innerContentPane.domNode.appendChild(viewer)
}