I know I can just bind any ui component to any events by using @UiHandler 
like this:

<g:FocusPanel ui:field="panel">

@UiField
FocusPanel panel;

@UiHandler("panel")
void handleClick(MouseDownEvent event) {
    //...
}

So far so good, but how can I "manually" add a mouse handler within the 
class constructor:
            panel.addMouseDownHandler(new MouseDownHandler() { //NPE
                @Override
                public void onMouseDown(MouseDownEvent event) {
                    Window.alert("mouse down");
                }
            });

If I write this in the constructor of the java class, I'm getting 
NullPointerException 
at this stage where the handler is added to the panel.
What am I missing here?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/IkAkkJ0IcP8J.
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