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 Central

refresh onshow() ?

Author Message
Lutz



Joined: 18 Apr 2005
Posts: 19
Location: Sweden

Posted: Thu Apr 21, 2005 - 2:50 pm    Post subject: refresh onshow() ? Reply with quote

Just found a fatal flaw in my stargate widget, it has to refresh to change "days left", I've tried to put javascript code in the "onshow()" funtion but it won't work.
View user's profile Send private message Send e-mail Visit poster's website AIM Address ICQ NumberWidgets
islayer



Joined: 21 Apr 2005
Posts: 66

Posted: Thu Apr 21, 2005 - 4:52 pm    Post subject: Reply with quote

its a fatal flaw in dashboard.apple have provided no way to refresh widgets.
with one of mine i just manipulate the contents of my main div with .innerHTML.its a hack but it works.
i havent been able to get window.location.reload() or any other javascript refresh command to work
View user's profile Send private message Send e-mail Widgets
zzen



Joined: 21 Apr 2005
Posts: 43
Location: Czech Republic

Posted: Thu Apr 21, 2005 - 4:53 pm    Post subject: Assign the handler Reply with quote

Make sure you not only define your onshow() function, but also asign it as the handler of the onshow event. This is done via widget.onshow = onshow; Check the Apple widgets (WorldClock) for working examples.
View user's profile Send private message Send e-mail Widgets
Lutz



Joined: 18 Apr 2005
Posts: 19
Location: Sweden

Posted: Fri Apr 22, 2005 - 12:26 pm    Post subject: Reply with quote

islayer wrote:
its a fatal flaw in dashboard.apple have provided no way to refresh widgets.
with one of mine i just manipulate the contents of my main div with .innerHTML.its a hack but it works.
i havent been able to get window.location.reload() or any other javascript refresh command to work


I have tried that for some time now, I get the innerHTML to work in safair, but not dashboard, how did you make it work?
View user's profile Send private message Send e-mail Visit poster's website AIM Address ICQ NumberWidgets
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