Support Article
Only one modal dialog can be opened:error adding attachments
Summary
User has configured a link, which on click opens a modal dialog which renders a section. In that section, they have a button configured which is required to attach the file to that corresponding item.
However, the attachment is not getting attached to the item and also not present in the clipboard. And gives a popup with an error .
Error Messages
Only one modal dialog can be opened at a time
Steps to Reproduce
1. Configure a link to open a modal dialog.
2. In the section rendered from modal dialog, configure a button with "pyAttachContent" as local action on its click event.
3. Observe the scenario after running the flow.
Root Cause
Opening another modal dialog is not supported when already one modal dialog is opened.
Resolution
Perform below steps inorder to achieve the reported requirement -
1. Configure a link to open modal dialog.


2. A button is configured in the modal dialog section as below - a section include of "pyWorkAttachmentsFeedElement" in repeating dynamic layout which is sourced with pagelist property "pyAttachments" of class "Link-Attachment" and a button to attaches the file to the current work item.
3. Below is the configuration of "Click to attach file" button.
4. Use the target as "Overlay" as opening modal dialog over other modal dialog is not supported and gives the reported error message.
5. Also, since refresh on overlay is not supported (interactions happen without any proper sequence), the attachment delete option is configured as below -
- Perform Save As of pyAttachmentsFeedElement section into application ruleset and modify the delete icon configuration as below:
6. And have an explict refresh on the modal dialog section, such that it refreshes the section to remove the attachment:
Published June 28, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.