Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Vista Sidebar Gadget Development

Reply
Thread Tools Display Modes

Vista Sidebar Gadget Development

 
 
Ishaan Dogra
Guest
Posts: n/a

 
      06-17-2008

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

 
Reply With Quote
 
 
 
 
Mark L. Ferguson
Guest
Posts: n/a

 
      06-24-2008
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
--
click the Ratings button. Voting helps the web interface.
http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a post''
Mark L. Ferguson

"Ishaan Dogra" <> wrote in message
news:...
> 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


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sidebar Gadget Development and Database Connectivity... Ryan Windows Vista General Discussion 1 04-13-2009 08:52 AM
vista sidebar gadget runtime error stephen0606 Windows Vista General Discussion 7 03-06-2008 06:45 PM
Vista Sidebar Gadget SteveTheOracle Windows Vista General Discussion 4 09-08-2007 12:16 AM
gadget sidebar in Vista Home Premium Felicita Windows Vista Installation 6 07-21-2007 06:18 AM
problem in sidebar gadger development Ed Windows Vista General Discussion 0 03-10-2007 04:50 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59