Hello, I'm having trouble getting UiHandler events to fire in a new application that I've created with the help of UiBinder.
I've recreated the issue using the most basic code I could come up with. Basically, a single button is created with UiBinder xml and the widget that is bound to it has a ClickEvent annotation. The app starts up, shows a popup message (to ensure that the verification method works) and then shows a single lowly button. When the button is clicked, I expect that another popup be shown but nothing actually happens. I'm pretty sure this is a case of developer error but I'm not sure what I'm missing. I've gone over the UiBinder documentation and the HandlerDemo.java sample code and didn't see anything extra or different from what I have. I've also deployed the simple code to AppEngine and tested under Chrome, Safari and Firefox. I don't see the alert popup using any of the browsers. http://tcope-testapp.appspot.com/ My environment is as follows: Eclipse 3.7 Indigo on Mac 10.6.8 GWT 2.4.0 And the source looks like this: // TestApp.java package com.testapp.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.dom.client.Document; public class TestApp implements EntryPoint { public void onModuleLoad() { MyView myView = new MyView(); Document.get().getBody().appendChild(myView.getElement()); } } // MyView.ui.xml <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"> <g:HTMLPanel> <g:Button ui:field="myButton" width="120px" text="Click me" /> </g:HTMLPanel> </ui:UiBinder> // MyView.java package com.testapp.client; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; public class MyView extends Composite { private static MyViewUiBinder uiBinder = GWT.create(MyViewUiBinder.class); interface MyViewUiBinder extends UiBinder<Widget, MyView> { } @UiField Button myButton; public MyView() { initWidget(uiBinder.createAndBindUi(this)); Window.alert("ok press the button..."); System.out.println("after initWidget"); } @UiHandler("myButton") void handleClick(ClickEvent e) { Window.alert("Click! [handleClick]"); System.out.println("Click! [handleClick]"); } } Anyone have any ideas? Thanks, Tyler -- 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=en.
