set content of dialog after opens

set content of dialog after opens


I need to create dynamic dialogs that are based on context of link
that opens the dialog, how can I set the content of the dialog after
it opens, or just before? I can't seem to get it to work.