Tuesday, September 30, 2014

Where to call an Action when user remove an uploaded image in GWTUpload?

I am using GWTUpload , the library is in here https://code.google.com/p/gwtupload/

The Example code at client side found on that website has this structure:

 // Attach an image to the pictures viewer  private OnLoadPreloadedImageHandler showImage = new OnLoadPreloadedImageHandler() {      public void onLoad(PreloadedImage image) {        //showImageFlowPanel code solution 1        image.setWidth("75px");        showImageFlowPanel.add(image);      }  };      private IUploader.OnFinishUploaderHandler onFinishUploaderHandler = new IUploader.OnFinishUploaderHandler() {        public void onFinish(IUploader uploader) {          if (uploader.getStatus() == Status.SUCCESS) {              new PreloadedImage(uploader.fileUrl(), showImage);              UploadedInfo info = uploader.getServerInfo();              String headShotImageUrl="http://"+Window.Location.getHost()+"/" +"images/uploaded/"+info.message;            //headShotImage code solution 2            if(!"".equals(headShotImageUrl) && UriUtils.isSafeUri(headShotImageUrl)){                headShotImage.setUrl(UriUtils.fromString(headShotImageUrl));            }                }        }      };  

The example uses showImageFlowPanel (solution 1) to store the image but I want to store the image inside headShotImage which take the url after user uploaded image successfully, see the headShotImage (solution 2) code above.

Ok, the headShotImage code work fine but I dont know how to remove it when users remove the image. If I use showImageFlowPanel as in the solution 1 then the program remove the image automatically for me and I do not need to do anything.

So my question is "Where to call an Action when user remove an uploaded image in GWTUpload?"


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment