Trying to remove pages from a TabView I stumbled accross the following:
var tabView = new qx.ui.tabview.TabView();
var doc = this.getRoot();
doc.add(tabView);

var pageList = [];
for (var i = 0; i < 10; i++) {
  var page = new qx.ui.tabview.Page(String(i));
  page.setLayout(new qx.ui.layout.VBox());
  page.add(new qx.ui.basic.Label('['+String(i)+']'));
  pageList.push(page);
}

for (var i = 1; i < 4; i++) { tabView.add(pageList[i]); }
var childList = tabView.getChildren();
for (var i = 0; i < childList.length; i++) {
  tabView.remove(childList[i]);
}
for (var i = 6; i < 10; i++) { tabView.add(pageList[i]); }

The given example creates a tabview and 10 pages. Some pages are added
and removed afterwards. But one page remains visible (number 2). A
workaround is to iterate backwards over the pages:
for (var i = childList.length-1; i >= 0; i--) {
  tabView.remove(childList[i]);
}

Is this expected behaviour?

For my purpose in general it would be quite handy to show/hide pages
such that I don't have to add/remove them all the time.

Sorry, I've too little experience with JS/Qooxdoo and too less time to
provide patches.

Cheers,
        Gereon


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to