开发者

GWT textbox KeyPressHandler issue

开发者 https://www.devze.com 2023-04-05 19:47 出处:网络
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

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消