Delete Attachement
-
Elie TodjomHas successfully completed the online course Basics (100)2 years ago #32969
Hi,
im trying t delete an attachment on thw mobile Client but I can’t get the object when I press the delette button. I’m using a sap.m.List in delete Mode so the delete Button is from that widget, Here is my code.
var lo_source = oEvent.getSource();
if (lo_source) {
var oOriginal = lo_source.getBindingContext(“variableHolder”).getObject(); // Error here.
var oEmpty = {};}
// getting cannot read properties of Undefined (reading getObject)
I don’t no to with what I should use in the place of variableHolder.
Attachments:
You must be logged in to view attached files.Jennifer HäfnerHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)Has successfully completed the Intermediate CertificationHas successfully completed the Advanced Certification2 years ago #32981::Hi Elie,
If you bind data to your list via a global variable (which means: you load data from the backend using a connector or a business object, then store the data in a global variable and then map this global variable to your list), the approach using ‘variableHolder’ as the binding context is correct.
However, if you bind the data directly to the list (e.g., via the data source property in the UI designer), the binding context is the ID of the screen where your list is.
We pre-implemented this functionality in the Client-Side Business Object ‘ITIZ_Utilities’, which is part of the standard content. The function that you need is ‘GetSelectedListItem’. This will extract the respective selected list item.
In your case, you are using the list in ‘delete’ mode and therefore want to trigger the ‘GetSelectedListItem’ functionality when pressing the ‘delete’ button. So, in the process designer, you need the ‘delete’ event of your list as the trigger:
I hope this helps you solve the problem.
You must be logged in to reply to this topic.