I suspect that the button widget is not properly added to the widget tree through parentHasWidgets.add(buttonWidget)
Doing something like parentDomElement.appendChild(buttonWidget.getElement()) will display the button correctly but without any dom events being registered. regards On 31 Dez. 2010, 01:58, UseTheFork <jvers...@gmail.com> wrote: > Hi, > > I am implementing a small GWT application containing a couple of > buttons. I take most of my inspiration from the contact tutorial. > > I fire the button events with something like this: > > display.getCreditsButton().addClickHandler(new ClickHandler() > { > @Override > public void onClick(ClickEvent event) { > Window.confirm("Firing CREDITS"); > Singletons.EVENT_BUS.fireEvent(new > DisplayCreditsEvent()); > display.getLabel().setText("Firing CREDITS"); > } > }); > > I have added extra debugging code (Window & Label). > > I sink the button events with code like this: > > Singletons.EVENT_BUS.addHandler(DisplayCreditsEvent.TYPE, > new DisplayCreditsEventHandler() { > @Override > public void onDisplayCreditsEvent(DisplayCreditsEvent > event) { > Window.confirm("Sinking CREDIT"); > History.newItem("Credits"); > display.displayCredits(); > } > }); > > I am 100% sure this code is executed, because I have set debugging > Window.confirm(...) statements all over the place and they pop-up > successfully. > > Unfortunately, the onClick(...) and onDisplayCreditsEvent(...) methods > are never called when I click on button. The application compiles > successfully and runs on Tomcat. > > What could I be doing wrong? What could I be missing? I am using GWT > 2.1.0 and Firefox 3.6.13. -- 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.