OEMR 5.0.1 using the dlgopen and dlgclose functions


#1

I am trying to use these for a project that requires cascading popups. Basically window A opens window B, which opens window C to search for something. After window C has successfully closed, window B can no longer close using dlgclose and a callback function, it no longer has a defined ‘opener’. If window C is not called, window B can close and reference the callback function just fine though. Is there something I might be missing in creating my iframe/popups with dlgopen, and it’s losing track of which is which? I am using the new OpenEMR\Core\Header and typically setting up ‘opener’ and ‘dialog’, sometimes more if needed. I can also provide more information, but didn’t want to start with a novel. This is 5.0.1 with the latest patch (7). I can put snippets of code in where they are called and closed too if that would help -
Thanks!


(Jerry P) #2

You have to ensure each dialog has unique id (if one is not set in call, an unique will automatically be assigned). Also ensure each script being called by dialog includes ‘opener’ in Header or include_opener called directly. There are several places in openemr that use cascading dialogs such as appointment events etc. Unsure how reliable dlgclose() is in cascades and with newer browsers, cross site is issue with window close but closing either way should not be an issue if using a callback in opening script.I don’t believe dlgclose() uses window.close() but it’s been awhile since developing so i’m unsure.