on 06-20-2022 3:58 PM
Hey experts.
I have a JS rule to clear a form when the user clicks on erase button. The expected behavior is clear all form inputs, including attachments component.
To listpickers, simple property, switches and notes, we're setting the values as null, empty string, false and empty string, respectly, using setValue method and it works good.
To attachment component, we've tryed a lot of values, as those I've mentioned and, obviosly, a empty array (since the documentation defines the value as array of objects). Nothing works and we catch a error that says that attachment component hasn't setValue method.
Could you help me teching how to reset or set a empty value to attachments component inside a form cell?
miqueias.maia MDK 6.2.5 has been released and contains a fix for the clearing of the attachments issue you describe. It is available for download from the SAP Marketplace now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Clearing the list of attachments is just like clearing other fields. Call setValue([]) and pass it an empty array.
However, there does appear to be a bug with the attachment control in 6.2.2 where the UI is not properly redrawn to "clear" the display of the existing attachments. The control however does not contain any attachments, even though the display is showing attachments present. If you call getValue on the control after clearing the attachments it will not return anything.
I will open an internal bug for this issue so we can look at fixing it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.