AJS.dialog2 missing initial Values when changing to another Issue in List View

Hi!

JIra 8.5.2, ATLAS 8.0.16

I created a Jira Server plugin which implements a web-panel. The panel contains a link (.vm)
When then link is clicked, a An AJS.dialog2 is shown.
I am doing the initialization of the dialog-elements (filling select2s, inputs…) within

AJS.dialog2(’#my-dialog’).on(‘show’, function() { init(); } );

When I close the dialog and change to another Issue from the List view on the left side and click the link to open the dialog, the dialog is shown but none of the initialization values are displayed, all elements are empty and I cant close the dialog by using AJS.dialog2(’#my-dialog’).hide();

Somehow the changing to another issue seems to destroy something in the dialog-context.

Any idea on how to fix this problem would be greatly appreciated!

Regards,
Hans

Hi @computerpraxis,

I believe you have identified the cause of this problem in your other post, Same AUI.dialog2 appears 2 times in Page Source. If your initialisation code is trying to find the dialog by ID, and there are multiple elements with the same ID on the page, you will always receive the first one in DOM element order.

I suspect this initialisation problem will go away once the multiple dialog issue is also resolved. Check the other post for more details on how to do that.

Cheers,
Daz