简体   繁体   English

gwtupload缺少工具

[英]gwtupload missing implement

I'm using the gwtupload library to change the standard upload Form. 我正在使用gwtupload库更改标准的上传表单。 Basically I just want to create a widget with an image and change it on :hover and :active via css. 基本上,我只想创建一个带有图像的小部件,然后通过CSS在:hover和:active上对其进行更改。

public class FileUploadFormImpl extends FileUploadForm implements HasClickHandler {

  private SingleUploader fileUpload;

  public FileUploadFormImplCostum(String actionUrl) {
    setAction(actionUrl);
    // Create Panel with costum Button
    DecoratorPanel widget = new DecoratorPanel();
    widget.setSize("100%", "100%");
    widget.setStyleName("costum-Button");

    // Create a FileUpload widget.
    fileUpload = new SingleUploader(FileInputType.CUSTOM.with(widget));
    fileUpload.setStyleName("costum-Button"); 
    fileUpload.setWidth("100%");

    fileUpload.getWidget().setSize("100%", "100%);");

    add(fileUpload);
  }
    @Override
    public HandlerRegistration addClickHandler(ClickHandler handler) {
        return addDomHandler(handler, ClickEvent.getType());
    }

The projects builds but doesn't run I'm getting the error message: 项目生成,但没有运行,我收到错误消息:

java.lang.AssertionError: Button should implement HasClickHandlers

But I'm having a click handler and it's basically the same as on the library example code page . 但是我有一个单击处理程序,它与库示例代码页面上的基本相同。 I don't get it is my implementation wrong or do I miss something. 我不明白这是我的实现错误还是我错过了什么。 Thx for any help. 感谢任何帮助。

您正在将未实现HasClickHandlers的DecoratorPanel方法传递给FileInputType.CUSTOM.with方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM