I am using gwt 2.3 with uibinder. In this I used a text box, On which I want to add keypress haldler. Here below is my code. for ui.xml
<g:HTMLPanel>
<g:AbsolutePanel ui:field="absolutePanel">
<g:HorizontalPanel>
<g:TextBox ui:field="searchTB" ></g:TextBox>
</g:HorizontalPanel>
</g:AbsolutePanel>
</g:HTMLPanel>
for .java
@UiField TextBox searchTB;
@Inject
public LibraryFormView(final Binder binder) {
widget = binder.createAndBindUi(this);
searchTB.addKeyPressHa开发者_Go百科ndler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
// TODO Auto-generated method stub
}
});
}
while running application & loading this page it is giving error like below.
[DEBUG] [v4workflow] - Rebinding com.nextenders.client.view.workflow.LibraryFormView.Binder
[DEBUG] [v4workflow] - Invoking generator com.google.gwt.uibinder.rebind.UiBinderGenerator
[ERROR] [v4workflow] - Method 'onKeyPress' must have a single event parameter defined.
I am not getting at what place I am wrong. Please help me out.Thanks in advance.
It seems like you have a method named onKeyPress
in LibraryFormView
that is erroneously annotated with @UiHandler
.
See http://www.google.com/codesearch#search&q=%22must+have+a+single+event+parameter+defined%22+package:http://google-web-toolkit%5C.googlecode%5C.com (it's in a loop over getUiHandlers
)
精彩评论