You can clear the selected files by setting the 'value' property to an 
empty string. (For a TYPE="FILE" input control, you can only set the 
'value' property to an empty string - trying to set it to anything else 
will be treated as an error and will be ignored by the web browser. For 
more info see: 
http://www.w3.org/TR/2011/WD-html5-20110525/common-input-element-attributes.html#dom-input-value
 beneath 
the subheading 'filename'). 

Unfortunately, there is presently no method in the GWT FileUpload class to 
enable this to be done easily. However, the second line of code below will 
achieve the desired effect.

FileUpload myFileUploadControl=new FileUpload();
.....
DOM.setElementProperty(myFileUploadControl.getElement(),"value","");


On Thursday, 22 December 2011 00:59:36 UTC-5, Rahul Sharma wrote:
>
> Hi, 
> Can anyone help me out in clearing the contents of the fileupload 
> widget. 
> I mean for textbox we write textBox.setText("") to clear the content 
> of it, is there anyway to clear the FIleupload also. 
>
> Thanks in Advance 
> rahul

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/IWTsS5WXjTIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to