Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Development

setPreferenceForKey("I'm Stuck","Need Help&qu

Author Message
hgehaucht



Joined: 13 Apr 2007
Posts: 1
Location: Berlin

Posted: Fri Apr 13, 2007 - 8:05 am    Post subject: setPreferenceForKey("I'm Stuck","Need Help&qu Reply with quote

Hi There.
I am encountering a strange behaviour with setting up preferences.
My widget graphically visualizes upcoming events set by the user. With each day passing the event come closer to the deadline.

All is working fine (well, for a beta version of my first widget, anyway) exepct one thing.
When adding an event, all other events stored in preference get 'undefined', but when I reload the widget everything is fine.

The code in question is
Code:
function addItem() {
   number = number + 1;
   name = document.getElementById("formName").value
   widget.setPreferenceForKey(name,"name"+number);
   widget.setPreferenceForKey(number,"ID");
   initializeIt();
}


Number is the complete number of preferences stored. So i increase it and saved the data. But what happens: The new data gets split up (only single characters are displayed) and the other data gets 'undefined'.
But when reloading the widget everything including the new data is there and fine.

I'm totally lost now. Can anyone help or give me tip? (I know, the code is not really nice and elegant - wanted to clean up later.)

Complete code and the widget itself can be found at
http://upcoming.komraum.com
or I can post it here, if that is more convienient.

Cheers, Alf
View user's profile Send private message Visit poster's website Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group