-
5 May 2012 11:49 AM #1
Answered: @UiHandler method not being invoked on Event
Answered: @UiHandler method not being invoked on Event
Note: running 3.0.0-rc2 since the GA release is not in Maven yet.
I am trying to re-create this example: http://www.sencha.com/examples/#ExamplePlace:helloworld(uibinder)
I have a button called "loginBtn", and I am defining my event handler thus:
I am using UiBinder, and "loginBtn" is defined as a ui:field in the UiBinder file, and I am calling createAndBindUi(this) inside of asWidget(). My widget is rendered perfectly, but my "onLoginBtnClicked" method is not being called when I click the button. I get no errors. Is there something else I need to do that I'm missing?Code:@UiHandler("loginBtn") public void onLoginBtnClicked(SelectEvent e) { ... }
-
Best Answer Posted by abshnasko
Whoa figured it out right after I posted! Hopefully this helps someone else. I'm migrating a widget from 2.2.5 to 3.0.0, and I use MVP. My UiBinder interface looked like this:
Where "LoginView" is the interface for my view. I had to change it to this:Code:interface LoginViewUiBinder extends UiBinder<Widget, LoginView> {
Where "LoginViewImpl" is the class in which I define my @UiHandler methods. This makes perfect sense, but I was not sufficiently astute to figure this out before I posted.Code:interface LoginViewUiBinder extends UiBinder<Widget, LoginViewImpl> {
-
5 May 2012 11:56 AM #2
Whoa figured it out right after I posted! Hopefully this helps someone else. I'm migrating a widget from 2.2.5 to 3.0.0, and I use MVP. My UiBinder interface looked like this:
Where "LoginView" is the interface for my view. I had to change it to this:Code:interface LoginViewUiBinder extends UiBinder<Widget, LoginView> {
Where "LoginViewImpl" is the class in which I define my @UiHandler methods. This makes perfect sense, but I was not sufficiently astute to figure this out before I posted.Code:interface LoginViewUiBinder extends UiBinder<Widget, LoginViewImpl> {


Reply With Quote