Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20531

Attachment Selector macro "Add attachment" button does not work properly in async contexts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 14.10
    • Attachments
    • None
    • Unknown

    Description

      When the attachmentSelector macro is included in a asynchronous context, like inside a class property custom displayer, a UIX (with "Asynchronous Rendering" set to true), or even inside a livedata entry, then the modal does not display when clicking on the "Choose an attachment" button, and the fallback form redirection is used instead.

      This happens because the javascript adding the click event on the button is using:

      document.observe('xwiki:dom:loaded', function() {
        // attach the event...
      }) 

      which has already been triggered, since the macro has been inserted asynchronously, and so the code is not run at all.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cdesableau Clément Desableau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: