TreeTable within TabPanel -- possible bug

Hi Guys,

I've been playing around with TreeTable and found that when it's added to a GWT TabPanel, the table data isn't displayed. Taking a peak in Firebug, I've found that the '.my-treetbl-data' style has it's width property always set to 0 when the TreeTable is within a TabPanel.

Details: gxt-1.2, Windows.

I've copied and pasted the sample class TreeTableExample from http://extjs.com/explorer/#treetable (line for line within zero changes to the onRender() method). I've also got the FileService service setup to return a view of my local file system; this is all fine and dandy and everything is great until the tree table goes into a TabPanel.

Apparently, tables don't recalculate their layout if their size has not been changed since the last time calculations were run; regardless of whether those calculations were valid at the time they were run. In my case, when the TreeTable is added to the document and rendered, it's on the non-selected tab (would be a similar situation if you're using a GXT cardpanel), so the width always returns 0.

See TreeTableView::resize() where the call to 'int width = treeTable.getOffsetWidth();' is made. This line is causing the width of the data portion of the table to be set to 0, so although the content is correctly loaded into the treetable, you can't see it.

The fix is easy after figuring all this out. Just call:

table.recalculate();

To force the table to recalculate and update it's sizes (e.g. when you actually activate that tab/cardpanel).