openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.m.UploadCollection.removeAllItems() does not work

Open Frank683 opened this issue 10 years ago • 7 comments

OpenUI5 version: 1.32.9

Browser/version (+device/version): all

Any other tested browsers/devices(OK/FAIL): not browser related

Issue: I have sap.m.UploadCollection with instantUpload=false. The user has selected several files for upload which are displayed in the list of the upload collection. If I want to remove these "files" from the control programatically with the removeAllItems() method of the upload collection, the aggregation "items" is cleared, but this.aItems of the control is not touched. Since the list seems to be bound to this.aItems the visual representation doesn't change either.

Maybe because of this behavior this explored example does rebuild the control using JS after the upload although the control has been defined in an XML view?

Since I'm using XML views I don't want to recreate the control by JS code if I want to remove the files from its list since this would mean double maintenance if anything of the control should be changed later on.

Is there any quick workaround to clear the selected files instead of completely recreating the entire control?

Frank683 avatar Jan 13 '16 10:01 Frank683

Thanks for reporting. I asked the colleagues to have a look into this: internal ref is 1670027733 Thanks! Thilo

ghost avatar Jan 15 '16 09:01 ghost

Hello Frank683, I'm Oli from the SAP dev team which is responsible for the UploadCollection. Thanks for the hint. I checked our implementation and provided a fix which is currently beeing reviewed. The fix will be included 1.32.11. Best regards, Oli..

GeneralDuke avatar Jan 15 '16 14:01 GeneralDuke

@GeneralDuke Please reopen this issue. I just tested the fix in 1.32.11 and it's still buggy.

How to reproduce:

Open a page with an sap.m.UploadCollection with instantUpload=false. Add 1 attachment. Call removeAllItems() on the UploadCollection. ==> The visual representation of the UploadCollection is indeed empty now. Add 1 attachment. ==> The visual representation of the UploadCollection shows one attachment. Call upload() on the UploadCollection

Result: 2 files are uploaded.

Frank683 avatar Feb 03 '16 14:02 Frank683

@Frank683, I will recheck again. In addtion I'm not sure if the fix is included in 1.32.11 because we needed more time as expected for regression testing. Best regards, Oli..

GeneralDuke avatar Feb 03 '16 16:02 GeneralDuke

At least something changed because calling removeAllItems() now removes all items "visually" but it doesn't seem to remove the FileUploader instances internally.

Frank683 avatar Feb 03 '16 17:02 Frank683

Reopening until this is clarified.

Please make sure the issue reports are in the right states...

akudev avatar Feb 04 '16 08:02 akudev

@Frank683 Hello again. I checked the code and found the root cause. Sorry for the need of a second fix. I didn't git the complete issue before. With 1.32.12 the fix will be available. Currently regression testing and code review is in progress. Thanks and best regards, Oli..

GeneralDuke avatar Feb 06 '16 16:02 GeneralDuke