PDA

View Full Version : [OPEN] [CLOSED][3.??] CardLayout



stever
10 Sep 2009, 10:11 AM
After working around some other issues after updating from SVN, I still found some problems with cardlayouts, that I could only solve if I set it to relayout on every item/tab change. It was kinda doing a layout of the top level things, and those things had their children hidden. After stepping though the debugger and watching what was happening, I came up with this slightly altered version of CardLayout's setActiveItem:


setActiveItem : function(item){
item = this.container.getComponent(item);
if(this.activeItem != item){
if(this.activeItem){
this.activeItem.hide();
}
var layout = this.layoutOnCardChange || !item.rendered;
this.activeItem = item;
item.show();
if (layout) {
this.layout();
if(item.doLayout){
item.doLayout();
}
}
}
},


It basically moves the this.layout() call into the if(layout) statement.

evant
10 Sep 2009, 3:04 PM
Can you provide a simple test case?

stever
10 Sep 2009, 5:45 PM
Can you provide a simple test case?

I've been trying. But since I find it happens intermittently, I've had a hard time. :( Sorry.

However, from a logical perspective, should, say, card/tab changes really be calling renderAll and firing afterlayout events when layoutOnCardChange == false?

mjlecomte
18 Oct 2009, 8:33 AM
This thread has been in the INFOREQ status for some time with no new information posted. I'm going to update the status to CLOSED.