• 0

An help building a Windows Gadget with Javascript


Question

Hi

I'm creating a windows gadget that simply loads a feed, that can be personalized in the settings.

All works well, i can set and get the config values in the settings.html, when i drop the gadget on the desktop it load flawlessy the feed (so i'm sure that the key code works), but when i change a config value it doesn't reload the main html page with the new feed.

I setted a button linked to the function that must run opn automatic to force-reload the new feed with the new settings, and it works this way.

So basically is the "System.Gadget.onSettingsClosed = SettingsClosed;" that is not fired

I readed a lot of tutorials, and even opened existing gadget but can't understand where is the problem :s

this is my js file included both in the settings.html and in the gadget.html (the gadget frontend)


/********************************************************************************/
System.Gadget.settingsUI = "settings.html";
System.Gadget.onSettingsClosing = SettingsClosing;
System.Gadget.onSettingsClosed = SettingsClosed;
/********************************************************************************/
function init() {
getRSS('feed', System.Gadget.Settings.read("provincia"));
}
/********************************************************************************/
function SettingsClosing(event)
{
if (event.closeAction == event.Action.commit)
{
var clr = provincia.options[provincia.selectedIndex].value;
System.Gadget.Settings.write("provincia", clr);
}
event.cancel = false;
}
/********************************************************************************/
function loadSettings()
{
var clr = System.Gadget.Settings.read("provincia");
provincia.selectedIndex = clr;
}
/********************************************************************************/
function SettingsClosed(event)
{
if (event.closeAction == event.Action.commit)
{
init();
}
}
/********************************************************************************/
[/CODE]

Hope you can help on this

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.