The iframe module appears to have issues when you try to delete a file input at a given index through script (rather than having the user click on the 'x' button).
Scenario #1 (size validation):
-----------------------------------------
1) subscribe to OnClientValidationFailed client event (implementation below)
a) alert("The file you have chosen is too large or is of a type that is not allowed.");
sender.deleteFileInputAt(sender.getUploadedFiles().length);
sender.updateClientState(); // (optional?)
2) user selects file that is 'too large'
3) event fires and works as expected...we get the alert message and the desired input disappears
4) user selects same or other file that is 'too large'
5) event fires, but does not work as expected this time
a) The desired input disappears, but now the select button won't bring up the file chooser and the select button's hover effect is lost.
Scenario #2 (duplicate file validation):
-------------------------------------------------
1) subscribe to OnClientFileSelected client event (implementation below)
a) this.isDuplicateFile = this.IsDuplicateFile(args.get_fileName()); // do we already have this file?
2) subscribe to OnClientFileUploaded client event (implementation below)
a) if (this.isDuplicateFile) {
this.ShowDuplicateFileMessage();
sender.deleteFileInputAt(sender.getUploadedFiles().length - 1);
sender.updateClientState(); // (optional?)
this.isDuplicateFile = false;
}
3) user selects file 'a'...everything works as expected...file added to list successfully
4) user selects file 'a'...everything works as expected...we get the duplicate warning message and duplicate is removed from list
5) user selects file 'a'....doesn't work as expected...duplicate is removed from list ok, but 'select' button no longer brings up file chooser and select button has lost its hover effect.
* Both of these scenarios work if I use the Silverlight module and the same source code.
* I have tried unsuccessfully on IE 8 compat/non-compat modes and Firefox 5
* I am using the latest Telerik release 2011.1.519.40
* I have a pretty minimalistic sample if you would like to take a look at it. I don't know where/how to send it though.
Scenario #1 (size validation):
-----------------------------------------
1) subscribe to OnClientValidationFailed client event (implementation below)
a) alert("The file you have chosen is too large or is of a type that is not allowed.");
sender.deleteFileInputAt(sender.getUploadedFiles().length);
sender.updateClientState(); // (optional?)
2) user selects file that is 'too large'
3) event fires and works as expected...we get the alert message and the desired input disappears
4) user selects same or other file that is 'too large'
5) event fires, but does not work as expected this time
a) The desired input disappears, but now the select button won't bring up the file chooser and the select button's hover effect is lost.
Scenario #2 (duplicate file validation):
-------------------------------------------------
1) subscribe to OnClientFileSelected client event (implementation below)
a) this.isDuplicateFile = this.IsDuplicateFile(args.get_fileName()); // do we already have this file?
2) subscribe to OnClientFileUploaded client event (implementation below)
a) if (this.isDuplicateFile) {
this.ShowDuplicateFileMessage();
sender.deleteFileInputAt(sender.getUploadedFiles().length - 1);
sender.updateClientState(); // (optional?)
this.isDuplicateFile = false;
}
3) user selects file 'a'...everything works as expected...file added to list successfully
4) user selects file 'a'...everything works as expected...we get the duplicate warning message and duplicate is removed from list
5) user selects file 'a'....doesn't work as expected...duplicate is removed from list ok, but 'select' button no longer brings up file chooser and select button has lost its hover effect.
* Both of these scenarios work if I use the Silverlight module and the same source code.
* I have tried unsuccessfully on IE 8 compat/non-compat modes and Firefox 5
* I am using the latest Telerik release 2011.1.519.40
* I have a pretty minimalistic sample if you would like to take a look at it. I don't know where/how to send it though.