Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-2005, 06:54 AM
Project Contributor
 
Posts: 54
Default 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).

Code:
<body>
  <table>
      <tr>
          <td>LALALALALALALALALALALALALALALALALA</td>
          <td>
              <p>A nice little paragraph before the wflow</p>
              <div id="WorkflowDiv"></div>
              <p>The footer information</p>
          </td>
      </tr>
  </table>
</body>
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.
Attached Files
File Type: zip complexTree.zip (18.8 KB, 359 views)
Reply With Quote
  #2 (permalink)  
Old 12-08-2005, 02:36 AM
Project Contributor
 
Posts: 54
Default

Any thoughts by anybody ?

I believe this is a bug of the DwtListView...
Reply With Quote
  #3 (permalink)  
Old 12-08-2005, 06:20 PM
Zimbra Employee
 
Posts: 4,792
Default

I think it's a bug. We've seen something similar if you resize certian columns in the mail client. Just haven't had the chance to dig into this yet.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #4 (permalink)  
Old 12-09-2005, 07:16 AM
Junior Member
 
Posts: 5
Default

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:

1. Do not override _getParentForColResize() under any circumstances.
2. Change DwtListView.prototype._handleColHeaderResize () so it always calculate offsets relative to the window, i.e. the last 3 lines are changed to :
var parent = this._getParentForColResize();
var loc = Dwt.toWindow(parent.getHtmlElement(), 0 ,0);
Dwt.setLocation(this._headerSash, ev.docX-loc.x);

from
var parent = this._getParentForColResize();
var loc = parent.getLocation();
Dwt.setLocation(this._headerSash, ev.docX-loc.x);


Either of these 2 fixed the problem for me, and I applied both.
__________________
jpenguin
Reply With Quote
  #5 (permalink)  
Old 12-09-2005, 01:03 PM
Zimbra Employee
 
Posts: 269
Default

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

Heladito, does this fix work for you as well?
Reply With Quote
  #6 (permalink)  
Old 12-12-2005, 02:14 AM
Project Contributor
 
Posts: 54
Default

Yep, it works for me too

Thanks a lot jpenguin
Reply With Quote
  #7 (permalink)  
Old 12-12-2005, 09:19 AM
Senior Member
 
Posts: 51
Talking CVS build not updated

Thanks for fixing the bug, I also had problems with it.

I saw that the CVS build hasn't been updated yet . Please don't forget it, nice people of Zimbra .
Reply With Quote
  #8 (permalink)  
Old 12-12-2005, 01:48 PM
Zimbra Employee
 
Posts: 269
Default

The fix has been checked in! Look for it in CVS or the next public/dev release. Thanks again.
Reply With Quote
  #9 (permalink)  
Old 12-12-2005, 02:33 PM
Senior Member
 
Posts: 51
Default

Nice, it is changed. Thx.
Reply With Quote
  #10 (permalink)  
Old 12-23-2005, 08:14 AM
Project Contributor
 
Posts: 54
Default

I am having the same sort of problem, but only under IE, when I swap columns.

Is anybody else having the same trouble ? Looks to me to be very similar to the previous problem.

Something to do with DwtListView.prototype._handleColHeaderMove ?

Last edited by Heladito; 12-23-2005 at 08:40 AM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.