I have not yet been able to isolate the code while reproducing the
problem. It's probably related to the actual structured of the page.
But I managed to get some more information using the debugger.

- The problem occurs when using a PushButton (constructed using the
constructor PushButton(Image image)), not when using a simple Button
- In the class CustomButton when the method onBrowserEvent is called
for a MOUSUP event :
...
case Event.ONMOUSEUP:
        if (isCapturing)
          isCapturing = false;
          DOM.releaseCapture(getElement());
          if (isHovering() && event.getButton() == Event.BUTTON_LEFT)
{
            onClick();
          }
        }
        break;
...


isHovering() returns true at the first click while it returns false at
the subsequent clicks

The method isHovering is implemented as follows

final boolean isHovering() {
    return (HOVERING_ATTRIBUTE & getCurrentFace().getFaceID()) > 0;
  }

At the first click getCurrentFace().getFaceID()) evaluates to 3, while
at the subsequent clicks, it evaluates to 1.
So there is probably something wrong in setting the correct face in
the particular situation.

I hope that this can provide enough information to find the real root
cause.

Danny

On Jun 1, 6:21 pm, Danny Goovaerts <danny.goovae...@gmail.com> wrote:
> My application is quite large. The button is several "levels" deep,
> i.e. in a FlowPanel which itself is in a HorizontalPaneI in a hierachy
> of divs. I will try to isolate while still reproducing the error.
> I would also try to step through the code in a debugger, but
> unfortunaly for this I need to move the mouse from the page to
> Eclipse, which prevents from reproducing the error.
> Danny
>
> On Jun 1, 4:17 pm, Ranjan <ranjan.n...@gmail.com> wrote:
>
>
>
> > Something like that should not have gone unnoticed for so long. Could
> > you post your code snippet?
>
> > On Jun 1, 12:07 pm, Olivier Monaco <olivier.mon...@free.fr> wrote:
>
> > > 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-tool...@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