I have found the reason.The Widget class prevent the event

switch (DOM.eventGetType(event)) {
      case Event.ONMOUSEOVER:
        // Only fire the mouse over event if it's coming from outside
this
        // widget.
      case Event.ONMOUSEOUT:
        // Only fire the mouse out event if it's leaving this
        // widget.
        Element related = event.getRelatedTarget();
        if (related != null && getElement().isOrHasChild(related)) {
          return;
        }
        break;
    }

Is it necessary to do this?

On 4月10日, 下午2时02分, ChaoS <[email protected]> wrote:
> I tried like this
>
> public class GridX extends Grid implements HasMouseOverHandlers,
>                 HasMouseOutHandlers {
>
>         public GridX() {
>                 super();
>         }
>
>         public GridX(int rows, int columns) {
>                 super(rows, columns);
>         }
>
>         public HandlerRegistration addMouseOverHandler(MouseOverHandler
> handler) {
>                 return addDomHandler(handler, MouseOverEvent.getType());
>         }
>
>         public HandlerRegistration addMouseOutHandler(MouseOutHandler
> handler) {
>                 return addDomHandler(handler, MouseOutEvent.getType());
>         }
>
> }
>
> but I found that the mouseover event doesn't occured as I wished.
> It was fired when mouse moving into the grid but not the cells
>
> On 4月10日, 下午1时54分, Vitali Lovich <[email protected]> wrote:
>
>
>
> > There should be something like addMouseOutHandler & addMouseOverHandler.
>
> > On Fri, Apr 10, 2009 at 12:02 AM, ChaoS <[email protected]> wrote:
>
> > > I tried addDomHandler function but it works bad.Any one can help me?- 
> > > 隐藏被引用文字 -
>
> > - 显示引用的文字 -- 隐藏被引用文字 -
>
> - 显示引用的文字 -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to