Closed swayongshen closed 2 months ago
Current workaround:
[]
) in the modelHi @swayongshen ,
Can you please provide a live example (jsbin or similar) that demonstrates the issue?
Best Regards, Nikolay Hristov
Hi @NHristov-sap please refer to this https://jsfiddle.net/yongshenswa/0L6v5hs4/31/
Also, do we have any idea about this error? It even exists in the Demo sample https://sapui5.hana.ondemand.com/#/entity/sap.m.upload.UploadSet/sample/sap.m.sample.UploadSet
Thanks a lot @swayongshen. I have created an internal incident DINC0034917 to follow-up on this one. The responsible team will get in touch with you here on github.
Also, do we have any idea about this error? It even exists in the Demo sample https://sapui5.hana.ondemand.com/#/entity/sap.m.upload.UploadSet/sample/sap.m.sample.UploadSet
You can ignore that one. The control owner has to change some control internal functionality.
Hi @flovogt, may I know if there are any updates regarding this issue?
I was getting these errors and warnings:
Then I imported both DataType
and UploadSetItem
and added this line of code:
this.uploadSet = this.byId('modelFiles') as UploadSet;
DataType.registerEnum('sap.m.upload.UploadSetItem', UploadSetItem); // added this
The errors have been resolved, but the warnings linger. I was wondering if DataType.registerEnum
is the correct way to resolve the errors, and if the warnings can be fixed?
The error message The type 'xyz' was accessed via global. Defining enums via globals is deprecated. Please require the module 'sap/ui/base/DataType' and call the static 'DataType.registerEnum'
is unfortunately quite misleading.
Its suggestion part only applies, if the type 'xyz' is indeed an enum. This is not the case for 'sap.m.upload.UploadSetItem' .
Therefore, calling DataType.registerEnum is wrong in this place. Please remove that code again!
The real issue is named by the warning line: `sap.m.upload.UploadSetItem' is not a valid data type. This had to be fixed in the code of the UploadSetItem control: 30d37ba15633773a1e2dd9485a03f9ea6a410e4f fixes this and will be part of the upcoming 1.121 release. As far as I can see, it also has been down ported to 1.120 as 1c08857fb8a22e6785c5a688fbedc7e60eeaf181 and should e part of the next patch in 1.120.
The misleading error message meanwhile also has been reworded. It now reads [DEPRECATED] The type 'xyz' was accessed via globals. Defining types via globals is deprecated. In case the referenced type is an enum: require the module 'sap/ui/base/DataType' and call the static 'DataType.registerEnum' API. In case the referenced type is non-primitive, please note that only primitive types (and those derived from them) are supported for ManagedObject properties. If the given type is an interface or a subclass of ManagedObject, you can define a "0..1" aggregation instead of a property
Hi @codeworrior, thank you for your response! May I know when will the next patch in 1.120 be released?
planned for next month
@flovogt Are there any updates? When will the patch arrive? I just integrated the Uploadset into an application and the role out for this app is planned for end of September.
The error message
The type 'xyz' was accessed via global. Defining enums via globals is deprecated. Please require the module 'sap/ui/base/DataType' and call the static 'DataType.registerEnum'
is unfortunately quite misleading.Its suggestion part only applies, if the type 'xyz' is indeed an enum. This is not the case for 'sap.m.upload.UploadSetItem' .
Therefore, calling DataType.registerEnum is wrong in this place. Please remove that code again!
The real issue is named by the warning line: `sap.m.upload.UploadSetItem' is not a valid data type. This had to be fixed in the code of the UploadSetItem control: 30d37ba fixes this and will be part of the upcoming 1.121 release. As far as I can see, it also has been down ported to 1.120 as 1c08857 and should e part of the next patch in 1.120.
The misleading error message meanwhile also has been reworded. It now reads
[DEPRECATED] The type 'xyz' was accessed via globals. Defining types via globals is deprecated. In case the referenced type is an enum: require the module 'sap/ui/base/DataType' and call the static 'DataType.registerEnum' API. In case the referenced type is non-primitive, please note that only primitive types (and those derived from them) are supported for ManagedObject properties. If the given type is an interface or a subclass of ManagedObject, you can define a "0..1" aggregation instead of a property
The mentioned fix was released with UI5 1.120.4.
The overall issue is still open and not fixed.
OpenUI5 version: 1.120.0
Browser/version (+device/version): Chrome, MacOS
Any other tested browsers/devices(OK/FAIL): -
URL (minimal example if possible): -
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
items
aggregation is binded to an array in a JSON model, this array has 2 elements, so UploadSet contains 2 items.1
and the newly added item also has index of1