sivarajankumar / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
0 stars 0 forks source link

Incorrect mouse event handling for ScrollTable/PagingScrollTable in hosted mode #295

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of gwt and gwt-incubator are you using?
GWT 1.7.0 and Incubator svn trunk at 2009/07

What OS and browser are you using?
XP, IE7

Do you see this error in hosted mode, web mode, or both?
Hosted mode only, work both in IE7 and Chrome

Hopefully using the test case you have generously provided, what steps will 
reproduce the problem? 
1. Use hosted mode to run the demo ( PagingScrollTableDemo ).

What is the expected output? What do you see instead?
When mouse point is moving into a cell, the cell should be highlighted.
And when click a row, the row should be selected.
But in hosted mode, nothing happened when mouse move or click in the table.

Workaround if you have one:
It seems that something wrong in getEventTargetCell() of 
com.google.gwt.gen2.table.override.client.HTMLTable while it is using some 
deprecated method. 
Temporary solution is to extend FixedWidthGrid and override 
getEventTargetCell() as following:

          public Element getEventTargetCell(Event event) {
            Element td = 
(Element)Element.as(event.getEventTarget()); // Changed from 
DOM.eventGetTarget(event);
            for (; td != null; td = DOM.getParent(td)) {
              // If it's a TD, it might be the one we're looking 
for.
              if 
("td".equalsIgnoreCase(td.getPropertyString("tagName"))) {
                // Make sure it's directly a part of this table 
before returning
                // it.
                Element tr = DOM.getParent(td);
                if (getBodyElement().isOrHasChild(tr)) { // Changed 
from DOM.compare which is not workable.
                    return td;
                } else {
                }
              }
              // If we run into this table's body, we're out of 
options.
                if (getBodyElement().isOrHasChild(td)) { // Changed 
from DOM.compare which is not workable.
                    return null;
                }
            }
            return null;
          }

Original issue reported on code.google.com by skye...@gmail.com on 31 Jul 2009 at 2:56