Does anyone know if it is possible to create a XUI dialog on the fly, solely in code?
I have tried to use the Application.createDialogFromDocument() method, but even though it says it takes in an org.w3c.dom.Document, it fails within the AOM code since it seems the method tries to call getKey() which is only defined in com.arbortext.epic.internals.aom.*, but not in the w3c spec for Document.
For now, I will revert to creating a stub XUI file with a single element, and add to it from there. Does anyone know if there is a way around this?
Thanks, Keith Berard XML Systems Analyst Milliman Care Guidelines LLC, A Milliman Company Tel +1 206 381.8166 email@example.com http://www.careguidelines.com/
Delivering evidence-based knowledge at the point of care
Use the Application.openDocument() method (without a file argument) to create a new XUI document. Then you can programmatically construct the document, then display the dialog with Application.createDialogFromDocument(), etc.
It saves some code to start with a skeleton xui file, unless you truly need to build the entire dialog dynamically.
Another interesting possibility is to transform an existing document to xui using an XSLT stylesheet.
In a pinch you can convert an org.w3c.dom.Document to an AOM document but there are usually ways to do what you want without resorting to this.
Hmm... when I attempt to do that, the resulting document doesn't seem to let me create an element.
Document xuiDoc = Application.openDocument(); Element xuiRootNode = xuiDoc.createElement("window"); xuiDoc.appendChild(xuiRootNode);
In which that second line throws an exception pointing to the native call. Should I be doing something differently? Since it fails on the createElement method, I'm guessing it's not an exception resulting from duplicate roots. Also, how would I set the DocumentType using openDocument? Would I even have to?
As for using a XUI stub... I have created a simple xui containing:
<window enabledocking="any"> </window>
It seems that without setting the enabledocking in the XUI itself, setting it programatically later has no effect, and the dialog will not dock.
Keith Berard XML Systems Analyst Milliman Care Guidelines LLC, A Milliman Company Tel +1 206 381.8166 firstname.lastname@example.org