I'm using the gwtupload library to change the standard upload Form. Basically I just want to create a widget with an image and change it on :hover and :active via css.
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
方法。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.