Vista Sidebar Gadget Development

  • Thread starter Thread starter Ishaan Dogra
  • Start date Start date
I

Ishaan Dogra

Hi

I am developing a vista sidebar gadget and I need to store the settings
entered by the user. I am using the following code to save the settings,
but I am not able to. I can't figure out what is wrong with it.

function onSettingsUnload(event)
{
if (event.closeAction == event.Action.commit)
{
var user = username.value;
var pass = password.value;
System.Gadget.Settings.writeString("username", user);
System.Gadget.Settings.writeString("password", pass);
event.cancel = false;
}
else
{
event.cancel=true;
}
}

Here username and password in the first two lines are the corresponding ids
of the input boxes in the html file.

Thanks in anticipation.

Ishaan
 
System.Gadget.settingsUI = "settings.html";
System.Gadget.onSettingsClosed = settingsClosed;

function settingsClosed(p_event) {
//OK clicked?
if (p_event.closeAction == p_event.Action.commit) {
//yes, read settings here
}
}

gadgets Build Your Own Windows Vista Sidebar Gadget:
http://msdn.microsoft.com/en-us/magazine/cc163370.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top