The current version of dialog is designed to be a viewport dialog, not related to any other element. The general plan is to build in support like you have described when we have layout support/modules in jQuery UI.
The workaround you're using seems reasonable. If it's not working as you'd expect, please create a bug ticket in the jQuery UI bug tracker:
<a href="http://ui.jquery.com/bugs/newticket">
http://ui.jquery.com/bugs/newticket</a> (requires registration)
It would be quite helpful if you could attach a minimal test case to the ticket.
Also, note: there is a dedicated mailing list for jQuery UI:
<a href="http://groups.google.com/group/jquery-ui">
http://groups.google.com/group/jquery-ui</a>- Richard