Not sure if this the appropriate place to post this ...

I was playing around with the TouchScroller in the new gwt 2.3 build,
which I am using in the left pane of this demo:  
http://gwt-touch-demos.appspot.com

One issue I had with the TouchScroller is that it suppressed click
events, so  I added the following code to the TouchScroller's
onDragEnd event:

    Point diff =
startTouchPosition.minus(lastTouchPosition.getPoint());
    if(diff.getX()==0 && diff.getY()==0) {

                        Element target = Element.as(
 
event.getNativeEvent().getEventTarget());

                        if(target!=null) {

                            int y =
event.getNativeEvent().getClientY();
                            int x =
event.getNativeEvent().getClientX();
                            NativeEvent clickEvent =
Document.get().createMouseEvent(
                                        "click",true, true,0, x, y, x,
y, false, false,
                                        false, false,
NativeEvent.BUTTON_LEFT, target);
                            target.dispatchEvent(clickEvent);
                        }
   }

This dispatches a click event to the touched element if the user
touched the scroll panel, but did not scroll.

Not sure if this is the best approach, but something the gwt team may
want to consider

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to