Tuesday, June 1, 2010

Re: ClickHandler not called on second click

Danny,

I had no problem (in dev mode). Here is my test case:

public void onModuleLoad()
{
Button b = new Button("click me");
b.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
RootPanel.get().add(new Label("clicked"));
}
});
RootPanel.get().add(b);
}

What's your test case?

Olivier

On 1 juin, 08:07, Danny Goovaerts <danny.goovae...@gmail.com> wrote:
> I have a button with a ClickHandler. When I move the mouse over the
> button and click the button, the ClickHandler is called. When I do no
> move the mouse away from the button, the ClickHandler is not called on
> any subsequent clicks. I have to move the mouse away from the button
> and back. Then the ClickHandler is called when I click again.
>
> To investigate, I have added a MouseDownHandler and a MouseUpHandler.
> These are called on subsequent clicks, only the ClickHandler is not
> called.
> As the focus stays on the button, I have tried hitting the enter key.
> This triggers calling the ClickHandler.
>
> I 've tried adding a DeferredCommand to the ClickHandler with a
> variaty of actions(remove focus, remove focus and set focus again),
> but this does not change anything.
>
> Environment
> - GWT 2.0.3
> - Vista
> - Chrome 6.0.408.1 dev / Firefox 3.5.9/ Internet Explorer 7.0
>
> There are several posts in this forum that describe a similar
> behaviour (e.g.http://groups.google.com/group/google-web-toolkit/browse_thread/threa...)
> but none have a solution.
>
> Any idea how to solve this?
>
> Thanks in advance,
>
> Danny

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment