Expand my Community achievements bar.

SOLVED

Deleting attachment from PDF sidebar and reflect UI changes (AEM designer 6.5 - formely livecycle)

Avatar

Level 3

When adding attachments via a user interface:

Add button Click event below: 

 

var myDoc = event.target;
var sFile = "myFile" + NumericField1.rawValue;
myDoc.importDataObject({cName: sFile});
var myDataObject = myDoc.getDataObject(sFile);
var sFileName = myDataObject.path;
ListBox1.addItem(sFileName,sFile);

 

 

AEM_USER1_0-1642780553302.png

 

the files are added and you can see them in the side bar. if I remove files from the UI it goes away from the sidebar.

 

QUESTION:

 

what is the event that triggers the removal of a file from a sidebar? 

 

AEM_USER1_1-1642780886270.png

 

I can see the form brings a pop up alert but after i say "yes" it goes away from the sidebar and that is correct. I need to be able to capture that event so that i can deleted from the list on the UI

 

AEM_USER1_2-1642780980529.png

 

I assume that this event should exist so that i can catch it in the javascript code of the form and manipulate the UI accordingly. right?

 

thank you

 

1 Accepted Solution

Avatar

Level 10

There's no event fired when an attachment is added or deleted over the UI.

3 Replies

Avatar

Level 10

You already using the getDataObject() method. Once you've deleted an attachment you need to recall it and refresh your list box. 

Avatar

Level 3

@radzmar yes that is exactly what i am doing from the "remove file" button on the click event i use the getDataObject to refresh the list box.

"if I remove files from the UI it goes away from the sidebar."

 

the questions remains. Is there a way to capture the event thrown from the sidebar delete button? as you can see on the last two pictures it throws a pop up and then deletes the file but I have not found a way to capture the event so that i can code the listbox refresh.

 

 

Avatar

Level 10

There's no event fired when an attachment is added or deleted over the UI.