It's not possible to close multiple pages at once directly from Mendix (yet), but I’ve created a (hacky) workaround once, that could also work in your case.
- Create a non-persistent entity 'ClosePageHelper’ with a boolean attribute ‘ClosePage’ (default false) and link it to your Document
- on your pop-up page, add a dataview with datasource microflow, with a GetCreate for your ClosePageHelper
- in that dataview, add a MicroflowTimer widget that calls a microflow that closes the page, and make it conditional visible based on the ClosePage attribute. The microflow timer must be set to execute once and start at once.
- now, when you want to close your multiple FileDocument pop-ups at once, loop over them, calling the ClosePageHelper_GetCreate again, and set the ClosePage attribute to true and refresh in client, This will trigger the MicroflowTimer to become active on your pop-up and it will trigger the microflow to close the page.
From Mendix Studio Pro v8.14 and onwards you can choose to close all pages.
You can probably achieve this by downloading the HTMLSnippet widget from the store and then using jQuery: $('.yourButtonClass').click(function() { $( ".popupCloseButtonClass" ).trigger('click'); }); Add a class to a button '.yourButtonClass' and then use that to trigger a click on the close button of your popups 'popupCloseButtonClass'. I believe it should work if the close button on your popups have the same class.