Taufeeq schrieb:

> I am create an component where in on singleClick of the grid cell I
> have to show an alert message displaying metadata of image. And, on
> doubleClick have to display the image in new window. For that I had
> created a class "MyHandler" which implements clickHandler and
> DoubleClickHandler and added an instance of "MyHandler" to
> addClickHandler of the Grid.
> 
> The problem is that whenever I double click on the Grid cell; onClick
> () caught the event and no DoubleClick event is generated.
> Could anyone provide any pointer for differentiating between
> singleClick and doubleClick on the Grid cell in the application?

In short, create a Timer in onClick, showing the dialog box
after the Timer reached its end. If onClick is called within
the lifetime of the timer, cancel the timer and perform the
operation you intend to be done for a double click.

You can skip the Timer-thing if you show the meta-data some-
where in your main-area. Then you just need to store
System.currentTimeMillis() in a variable and check the
difference the next time if it is within some threshold to
decide if you have to show the preview-window or not.


Regards, Lothar

--

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=.


Reply via email to