Deleting attachment from PDF sidebar and reflect UI changes (AEM designer 6.5 - formely livecycle) | Community
Skip to main content
Level 4
January 21, 2022

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

  • January 21, 2022
  • 3 replies
  • 990 views

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);

 

 

 

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? 

 

 

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

 

 

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 🙂

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

radzmar
Level 10
January 23, 2022

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

Level 4
January 24, 2022

@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.

 

 

radzmar
Level 10
January 24, 2022

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