on 09-13-2010 11:33 PM
I'm uploading excel files, it works when i upload "file1.xls" and then "file2.xls", but when i try to upload the same file 2 times, it's where it goes wrong. Because the "FileUpload component" does not get clean.
Example:
I have a FileUpload component, when i upload "file1.xls" the component resource value is set to 'null', wich is right, but if upload the same file once again, the resource value is set to 'null' but the input is not cleaned, it still showing the file path, wich should be 'null'.
I mean if upload "file1.xls", "file2.xls", "file1.xls", "file2.xls"..etc. It works.
If upload "file1.xls","file1.xls"...etc. It fails.
what's the error message?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is not error message, the problem is that the input of the path does not gets cleaned, for example if you select a file from "C:\file.xls" in the input you'll see "C:\file.xls", once it has been uploaded, you'll see in the input " ", but if you try to upload the same file once again you will have in the input "C:\file.xls", once the file has been uploaded (for second time) the input is 'C:\file.xls', it does not gets cleaned at the second time.
Thanks for your answer.
I did, and that's the problem, when i upload different files, it works, but when it's the same file, does not work, rather, functions halfway, the attribute value is set to null, but for some reason, the input, continues showing the path. And if i try to upload the file for the third time, it says the path is null.
hope i explained myself, thanks for your answers.
public void onActionLoadExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionLoadExcel(ServerEvent)
IUploadElement uploadElement = wdContext
.currentUploadElement();
IWDResource excelPath = uploadElement.getExcelPath();
if (excelPath != null) {
//Method for upload file
wdThis.wdGetUploadController().loadXls();
// Clean the path
uploadElement.setExcelPath(null);
} else {
mesageManager.reportWarning("It's null");
}
//@@end
}
// the excelPath is the resource attribute
Thanks.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.