Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ashwani on Jul 17, 2009 08:11
open dhtmlx forum
Code causing Out of Stack Space Error

Hi Alex,

Following is the code:

dhxWins1 = new dhtmlXWindows();

dhxWins1.setImagePath(imgPathWindow);

dhxWins1.setSkin("c594");

Window1 = dhxWins1.createWindow("Window1", 50, 50, 900, 600);

Window1.setText("Some Text");

tabbar = Window1.attachTabbar();

tabbar.setImagePath(imgPathTabbar);

tabbar.setSkin("c594");

var layout1= tabbar._cells(dhxWins1, "Tab1").attachLayout("2E", "c594");

var layout2 = tabbar._cells(dhxWins1, "Tab2").attachLayout("2E", "c594");

var layout3 = tabbar._cells(dhxWins1, "Tab3").attachLayout("1C", "c594");

tabbar.attachEvent("onSelect", function(id) {

var obj;

if (id == "Tab1") {

this.setTabActive("Tab1");

}

else if (id == "Tab2") {

this.setTabActive("Tab2");

obj = new WServices.WService();

obj.GetValue(successGetValue, failureGetValue);

}

else if (id == "Tab3") {

this.setTabActive("Compose");

}

});

Using onSelect event, i can not click on any tab even.

Thanks.

Answer posted by Alex (support) on Jul 20, 2009 01:11

Hello,

setTabActive calls onSelect evetnt - that is the reason for the issue. If you don't want to call onSelect event, you can use false as the second parameter of the setTabActive:

tabbar.attachEvent("onSelect", function(id) {
var obj;
if (id == "Tab1") {
this.setTabActive("Tab1",false);
}
else if (id == "Tab2") {
this.setTabActive("Tab2",false);
obj = new WServices.WService();
obj.GetValue(successGetValue, failureGetValue);
}
else if (id == "Tab3") {
this.setTabActive("Compose",false);
}
});