I am embedding GRE/XRE (XULRunner 1.8.0.4/1.8.1a) using Delphi BDS 2006. I
have been very successful so far but now I've hit a snag with allowing GRE
to use it's own components/dialogs for situations where the user should be
prompted for input. I have focused on the "unknownContentType.xul" dialog
which is instantiated by the nsHelperAppDlg.js component. These "built-ins"
live in the XULRunner/Components and XULRunner/Chrome directories.
The javascript is correctly registering an nsIHelperAppLauncher provider.
The "Show" method gets invoked in the javascript. The javascript correctly
makes it's connection back to my embedding wrapper layer (Delphi) in that I
see the Window Watcher call to open a window. I do so and hand back a
refererence to nsIDOMWindow when all that is done. The dialog
"unknownContentType.xul" is then shown correctly but that's it. There is no
behavior as the "dialog" reference created by the Show call is null by the
time the dialogs "OnLoad" method is called.
Here is a typical error message when the unknownContentType.xul dialog is
loaded by nsHelperAppDlg.js. Basically the same message for every reference
to "dialog" within this piece of XUL.
'[JavaScript Error: "dialog is not defined" {file:
"chrome://global/content/bindings/dialog.xml" line: 348}]'
I'm not sure where to proceed from here. It seems like the reference to
"dialog" goes out of scope once the XUL dialog is launched. However, I can
clearly see in the nsHelperAppDlg.js code where this object is first created
and later set into the XUL DOM (for lack of a better term) as follows;
var ir =
aContext.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
var dwi = ir.getInterface(Components.interfaces.nsIDOMWindowInternal);
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
this.mDialog = ww.openWindow(dwi,
"chrome://mozapps/content/downloads/unknownContentType.xul",
null,
"chrome,centerscreen,titlebar,dialog=yes,dependent",
null);
// Hook this object to the dialog.
this.mDialog.dialog = this;
I know for a fact that there is an object represented by this.mDialog after
some extensive testing. However, the added reference, this.mDialog.dialog,
appears to be null when XUL dialog processes it's onload event. I even tried
specifying an arbitrary variable and it's value on this.mDialog and it too
was "out of scope" when the onLoad() event was processed.
Near as I can tell this is my number one blocker currently preventing me
from using the "built-in" components and dialogs that ship with
XULRunner/Firefox. My preference would be to not have to code our own
prompts/dialogs so that we can maintain a similar LAF when we eventually
migrate to XULRunner altogether.
I have done a lot of Googling on this but I'm unable to find anything other
than a couple of other similar posts dating as far back as 2001 or earlier
where other explorers ran into a similar issue in utilizing
"commonDialog.xul".
I sincerely hope someone here has answer. I'm stumped.
Best Regards,
Tom Clowers
Expeditors International of WA, Inc.
tom dot clowers that expeditors ditto <mailto:[EMAIL PROTECTED]>
com
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding