My main page has my ListManager on it which creates a BorderLayout with a Grid in north, and several ContentPanels added as tabs to the center.
A couple of those ContentPanels create ListManagers.
My ListManager puts the class "asp-listmanager" on its container, and when created, scans up the parentNode axis, and finds its containing ListManager. If it finds one, it sets monitorWindowResize to false in its own BorderLayout, and subscribes to the parent ListManager's "layout" event.
This works great, all my child ListManagers lay themselves out when I collapse the parent's north region.
Problem is, that in hidden tabs the width gets set to zero, so when I next visit that tab, I see blue.
tweaking the browser window to resize triggers the main ListManager's layout, which causes the ListManager in the blank tab to lay itself out, and it reappears.
This is a bug? Or is calling layout() on a BorderLayout on a hidden tab forbidden?
The ListManagers in the tabs subscribe to the parent ListManager's "layout" event (it extends Observable). That's how they know when to re-do their layouts.
The parent ListManager doesn't have a clue what is in the content it has been configured to load into it's center "Detail" region. It just creates a load of ContentPanels, adds them to the region and then, sets their URLs. From then on, it calls the new refresh() on visible ones when its row selection changes, and sets the active state to false on hidden ones.
Why is it calculating the width as zero? isn't all the layout stuff done with "visibility:hidden" now, so that measuring works?
Well this turned out to be fitToFrame:true with autoWidth:true on the ContentPanel, and autoScroll:false on the Region.
I got it the wrong way round. As you said in another thread, the ContentPanels, should usually size themselves fitToFrame:false, and have the Region's autoScroll:true allow the Region to scroll any ContentPanel that has lots of data in it, and has a large height.
getViewSize() on a BorderLayout, which is also a hidden ContentPanel (hidden using visibility:hidden;position:absolute;top:-20000px;left:-20000px) with width:auto returns zero width. The absolute positioning zeroes the offsetWidth.