is your object 'settingsvar' a global variable If you defined it within a function in your gadget.htm, it will not be available to your flyout or settings pages.
I'm seeing this weird behaviour too where the System.Gadget name space is failing (or returning nothing), but it's in very specific and odd conditions. I'm sure it didn't do this before.
I have a gadget which has run for a year, and hasn't had that many amendments. You click on a story to open a flyout. You click on next or previous in the flyout to navigate to the next story which is opened in the same flyout. Now if I have debugging on, any and every call to System.Gadget (eg System.Gadget.Settings) fails after the user clicks on next or previous. If debugging in IE is switched off, the gadget works. I was originally investigating another error to do with the focus being lost on the flyout, and a layer appearing over the flyout. I could have sworn this System.Gadget error wasn't present a month or so back when I last checked (and the code hasn't been checked since - a few patches have been downloaded and VWD 2008 has been installed).
sorry to dig up an old thread but i didnt want to start a new one for something that seems to be covered ere anyway, is it possible that my sidebar does not have these apis i could have a older version maybe i ask because im trying to access the gadget settings from a flyout and System.Gadget.document.parentWindow.settingsvar does not work
my set up
gadget.html: flyout function, settings var., and button
settingsvar = "<dynamically set from the settings window>";
Oh and in answer to what happens when you use try catch ... it hops on and fails on the next to call to System.Gadget in the code... I'm not using reload anywhere in the code, could anything else be causing this behaviour
I set a SettingClosing event up in the gadget.js file. When the SettingClosing event fires, I can successfully set event.cancel=true, and the settings window does not close.
However, I'd like to display a message why the window is not closing. This means having code running in the gadget accessing html in settings. Ive tried several things, including the following:
System.Gadget.Settings.document.parentWindow.spanStatus.innerHTML="Too many Devices";
but it fails.
Help, please. How do I reference the settings html elements from a SettingsClosing event in the gadget
Sorry to keep on answering my own questions, I have found the line that is the culprit. The code that assigns to the System.Gadget.Flyout.file is causing it to fail. Although I need some explanation as to why please
Guilty line:
System.Gadget.Flyout.file = filename +
"WithAdFlyout.html";
This code will work (alert box displays the line "Video" or "Text" depending on the context it was called in).
This same code in reverse will fail on the alert line with an "object doesn't support this property or method" error, as System.Gadget mysteriously disappears:
Most Gadgets wouldn't work if they didn't exist. Have you checked if other Gadgets work
Use of "window.location.reload" will cause the System namespace to fail. What error do you get if you wrap the code in a try/catch
not sure what you mean by Most Gadgets wouldn't work if they didn't exist. as for try/catch i get no error, its like js isnt even running, should i post all the code
Most Gadgets make use of the System.* namespace, so would fail to work.
If the JS isn't running, you probably have an error in the code which is either causing it not to compile, or generating an error and stopping execution.
Gadget/flyout communication
R.Tutus
is your object 'settingsvar' a global variable If you defined it within a function in your gadget.htm, it will not be available to your flyout or settings pages.
tenholde
Ludo-R
And to make matters worse, if I try it on separate machine, with a separate install of the same gadget, the behaviour isn't replicated!
Chris
Lentilbean
I'm seeing this weird behaviour too where the System.Gadget name space is failing (or returning nothing), but it's in very specific and odd conditions. I'm sure it didn't do this before.
I have a gadget which has run for a year, and hasn't had that many amendments. You click on a story to open a flyout. You click on next or previous in the flyout to navigate to the next story which is opened in the same flyout. Now if I have debugging on, any and every call to System.Gadget (eg System.Gadget.Settings) fails after the user clicks on next or previous. If debugging in IE is switched off, the gadget works. I was originally investigating another error to do with the focus being lost on the flyout, and a layer appearing over the flyout. I could have sworn this System.Gadget error wasn't present a month or so back when I last checked (and the code hasn't been checked since - a few patches have been downloaded and VWD 2008 has been installed).
Chris
Yulia
sorry to dig up an old thread but i didnt want to start a new one for something that seems to be covered ere anyway, is it possible that my sidebar does not have these apis i could have a older version maybe i ask because im trying to access the gadget settings from a flyout and System.Gadget.document.parentWindow.settingsvar does not work
my set up
gadget.html: flyout function, settings var., and button
settingsvar = "<dynamically set from the settings window>";
function
emailFlyout(){
System.Gadget.Flyout.show = true;System.Gadget.Flyout.file =
"email.html";}
...
<
button onclick="emailFlyout();">email</button>now email.html the fly out i have
settinginfo = System.Gadget.document.parentWindow.settingsvar;
Nigel Hamer
rauhanlinnake
Oh and in answer to what happens when you use try catch ... it hops on and fails on the next to call to System.Gadget in the code... I'm not using reload anywhere in the code, could anything else be causing this behaviour
Chris
Susand
Gadget accessing Flyout:
Flyout/Settings accessing Gadget:
chris441962
Help with similar problem:
I set a SettingClosing event up in the gadget.js file. When the SettingClosing event fires, I can successfully set event.cancel=true, and the settings window does not close.
However, I'd like to display a message why the window is not closing. This means having code running in the gadget accessing html in settings. Ive tried several things, including the following:
System.Gadget.Settings.document.parentWindow.spanStatus.innerHTML="Too many Devices";
but it fails.
Help, please. How do I reference the settings html elements from a SettingsClosing event in the gadget
Ed
r3n
Thanks so much Bruce & Jonathan.
A very merry xmas from Kuta, Bali.
Ty
Squid Dog
Use of "window.location.reload" will cause the System namespace to fail. What error do you get if you wrap the code in a try/catch
yuchuan
Sorry to keep on answering my own questions, I have found the line that is the culprit. The code that assigns to the System.Gadget.Flyout.file is causing it to fail. Although I need some explanation as to why please
Guilty line:
System.Gadget.Flyout.file = filename +
"WithAdFlyout.html";This code will work (alert box displays the line "Video" or "Text" depending on the context it was called in).
alert(System.Gadget.Settings.read(
"FlyType"));System.Gadget.Flyout.file = filename + "WithAdFlyout.html";
This same code in reverse will fail on the alert line with an "object doesn't support this property or method" error, as System.Gadget mysteriously disappears:
System.Gadget.Flyout.file = filename + "WithAdFlyout.html";
alert(System.Gadget.Settings.read("FlyType"));
It seems that this is particular only to certain setups, given I can see it every time on my pc, but it can't be seen on another pc. Any ideas please
Chris
Arshu
not sure what you mean by Most Gadgets wouldn't work if they didn't exist. as for try/catch i get no error, its like js isnt even running, should i post all the code
SnakeSV
If the JS isn't running, you probably have an error in the code which is either causing it not to compile, or generating an error and stopping execution.