Hybrid View

Problem with column resize in DwtListView

I have a strange problem regarding sashes automatically created by DwtListViews. I have attached the full code of my example and a screenshot to illustrate the problem and for anybody who wants to try it out.

The situation is the following:
I have a DwtTree and a DwtListView (4 columns) separated by a DwtSash (HORIZONTAL_STYLE). In addition, I have some existing raw HTML in which I put the Dwt widgets. The raw HTML is the following (generated by the jsp).

The widgets are "put" in the div element with id "WorkflowDiv" as follows:

Code:

document.getElementById("WorkflowDiv").appendChild(this._app.getHtmlElement());
where this._app is the DwtShell of the example.

The whole thing displays correctly in the browser. However, when I click on one of the columns to resize it, the black line representing the sash between the 2 columns is shifted to the right. Actually, it is shifted to the right, the size of the first cell in the raw HTML. That is, if the first cell of the raw html table of my example has a width of 100px, when you click on the sash of the listview to resize your column, you'll have the black line display 100px to the right of the place you clicked.

How can I solve this ? Is this a bug ?

If you check out my screenshot, I clicked where I put the "red 1" and the black line appears "x" number of pixels to the right. The value of x, is the value of the first cell containing the "LALALA" text.

I found the bug. There are 2 problems I see. At the end of DwtListView.prototype._handleColHeaderResize ()
it should determine where to redraw the column resize sash by subtracting the Dwt parent widget HTML element's X (relative to the window) from the mouse event X (relative to the window too), the first problem is this method is subtracting parent HTML element's offset relative to its parent (when the parent widget is absolute instead of static style) instead. The 2nd problem I see is that the DvListView widget (which has a static style) needlessly overrides DwtListView's _getParentForColResize() method so that the method returns its parent widget, a DwtTabView (absolute style). These two factors combined cause the offset calculation to be off, in this case it's off by the width of the non-Dwt HTML div into which the tab view is set child of.

I don't see why anyone want to override _getParentForColResize(). So I see 2 fixes here:

jpenguin, thanks for the fix! I tested it out with the web client and doesnt seem to break anything (i say "break" b/c we dont see this bug in the mail client). Although, I do recall seeing this bug when creating new list views but dont remember how i avoided it