How to refresh a macro image placeholder in edit mode

We are developing a new version of the Balsamiq Wireframes add-on for Confluence Server.

Each add-on macro will be associated with a single wireframe. The macro placeholder will display the PNG associated with the wireframe (PNGs are attached to the wiki page) .

In the new version of the add-on editor, the user can modify different wireframes in the same editing session.

When the user exits the add-on editor, we need to refresh the image placeholder of all the macros whose wireframes have been modified.

At the moment we are able to update only the placeholder of the macro from which the add-on editor has been launched.

Here there is a short screencast describing the scenario

Is there a way to solve this issue? Is it possible to list and update all macro associated to an add-on?

I’d do this in javascript by searching through the dom for image which follow your naming convention and refreshing them when your custom editor exits.

I’m doing this by passing attachment IDs saved during our edit session info in the saved macro params and building the edit preview dynamically using that info.

Hi friends, finally I got the time to apply your useful suggestions and… it works!

Thanks for the help!

Hi guys, could you please explain what exactly to do to replace the image dynamically?
The tutorials only show how to select from some predefined pictures, but mine will be generated on the fly depending on the user input.