Thanks Brian, Steve, and Clay for the tips. It all sounds so easy-peasy
lemon-squeezie. 😉
I saw that ACL has flags to assign properties when a document is opened; I
didn't realize we had some of those options here.
That createDialogFromFile() might work better, and having some explicit
direction beforehand is helpful. As Peg Hellyer instructed me back when I
was learning FOSI: "the sooner you code, the longer it takes."
It sounds like setting the parent may help keep a dialog linked to the
parent document. The appdata attribute approach also sounds pretty nifty.
Reminds me of a case where I'm storing some transitory information in an
invisible button label (how's that for weird?).
Regards,
Jason
"Helberg, Clay" <chelberg@spss.com>
09/05/2006 08:36 PM
Please respond to
<adepters@arbortext.com>
To
<adepters@arbortext.com>
cc
Subject
RE: XUI handling: read-only and linking a dialog to a document
Hi Jason, et al.--
I think you can get around the first problem by just not calling
openDocument() at all. If you use createDialogFromFile(), I don't think
you need to open the document separately--createDialogFromFile() handles
opening the document for you. We've used this approach in our code for
quite a while now, and while I haven't tested it explicitly, we've never
had a problem with multiple instances of the dialog colliding in the way
you describe. Heck, I can even have two instances of the dialog open on
the same machine, associated with different documents, and everything
works nice and smoothly.
(Dunno if it matters, but just for the record, *everyone* in our shop gets
a read-only copy of the XUI documents, because they're checked in under
our source control system. No one gets the "read only" warning you
describe, presumably because that's based on a separate locking mechanism
specific to Epic, which I think is triggered by the openDocument() call.)
As for tying a XUI dialog to its correct document when multiple documents
are open, the parent property is probably the canonical method for doing
so. However, I find the methods for getting from a dialog to a view to a
document and back again a bit tedious, so I do it a different way: when
the dialog opens (usually in response to an event on the target document),
I set the appdata attribute on the dialog document's <window> element to
the target document ID. That way I always know where to find it when I
need to look it up, with a simple
dlgdoc.documentElement.getAttribute("appdata").
--Clay