Events in dialogs

javascript
java
ajs
jira-plugin
jira-server

#1

I’m opening a dialog via the Javascript AJS This is code from my velocity template.
Link below
https://pastebin.com/WFV1EiqB

The problem is that this code works only for the first show dialog. If I open a dialog, then close it and open up a second dialog this doesnt work

example in created gif

Whats problem?

Thanks for respond