Closed
Bug 304995
Opened 19 years ago
Closed 19 years ago
No filepicker comes up under WIN2000
Categories
(Toolkit Graveyard :: XULRunner, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: andreas.otte, Unassigned)
Details
In my xulrunner application I want to open a filepicker with code similar to the
one following below. This works as expected on linux, but on Win2000 nothing
happens, no filepicker comes up. Starting with -jsconsole reveals no errors or
warnings:
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp =
Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker );
fp.init( this.mDialog,
"Load",
nsIFilePicker.modeOpen );
if ( fp.show() == nsIFilePicker.returnOK && fp.file ) {
loadTask(fp.fileURL.spec);
}
Happens on nightly builds of 1.8. What am I missing?| Reporter | ||
Comment 3•19 years ago
|
||
No, still does not work. Maybe it has something to do with developing under linux and deploying under windows too. Is there a ready example developed under windows that uses the filepicker I can try?
Comment 4•19 years ago
|
||
Are you able to debug, at least from JS? Same code works for me, with s/this.mDialog/window/. Maybe this.mDialog is null? Is it not a nsIDOMWindow?
Comment 6•19 years ago
|
||
You should get an NS_ERROR_FAILURE exception when you pass a null (or otherwise invalid) parent window to init(). Also note that you must specifically set the pref javascript.options.showInConsole to true for any errors to show up in the JS Console.
| Reporter | ||
Comment 7•19 years ago
|
||
reply to comment #6) > Also note that you must specifically set the pref > javascript.options.showInConsole to true for any errors to show up in the JS > Console. I will check this as soon as I have access to my computer at work again.
| Reporter | ||
Comment 8•19 years ago
|
||
Hmmm ... trying to open the FilePicker for load still does nothing, not even an error, but FilePicker for SaveAs results in this: Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIFilePicker.init]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://venn/content/venn.js :: saveAsTask :: line 1870" data: no] Source File: chrome://venn/content/venn.js Line: 1870 I will investigate ...
| Reporter | ||
Comment 9•19 years ago
|
||
I now see the exception on linux too with the latest 1.8 xulrunner. Works fine with window instead of this.mDialog. Very interesting, I will check again against win2000.
| Reporter | ||
Comment 10•19 years ago
|
||
Ok, works on linux and windows. Thanks guys for the hint. What did I learn: I was lucky that it worked on linux as long as it did. Beware of bad examples floating around.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•19 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•19 years ago
|
Status: REOPENED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → WORKSFORME
| Assignee | ||
Updated•9 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•