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

Having a problem with a widget, could you help me ?

Author Message
MrGando



Joined: 12 Mar 2008
Posts: 2

Posted: Sun Apr 20, 2008 - 11:36 am    Post subject: Having a problem with a widget, could you help me ? Reply with quote

Hi guys, I am trying to develop a widget that executes a php script.

my phpscript is located in Widget.wdgt/script.php

if I go to terminal and then do cd Widget.wdgt , and then :

/usr/bin/php script.php

the script runs with no problems and returns the value I need.

I created two functions in a php.js ( located in Widget.wdgt/php.js ),

this functions are :

function getGifURL()
{
var cmd = widget.system("/usr/bin/php get_gift.php", pasteTheGift);
}

function pasteTheGift()
{
document.getElementById('OutputLayer').innerHTML = output.outputString
}

This functions are triggered from a button located in mywidget.html

in that widget I have a button to trigger the getGiftUrl and a div to paste the php generated code

<input id="evaluate" value="evaluate" type="button" onclick='getGifURL();'/>
php code should be here


****(this goes into a div , but the browser is executing de
tags... so "php code should be here" goes into a div with id="OutputLayer" .

The problem is that when I click the evaluate button, I get this msg in the console:

4/20/08 12:27:15 PM DashboardClient224 (com.nicolasgoles.widget.Integrator) file:///Users/nicolasgoles/Library/Widgets/Integrator.wdgt/php.js: Value undefined (result of expression widget.system) is not object. (line: 3)

4/20/08 12:27:15 PM 0x0-0xa00a.com.apple.dock114 2008-04-20 12:27:15.888 DashboardClient224:10b (com.nicolasgoles.widget.Integrator) file:///Users/nicolasgoles/Library/Widgets/Integrator.wdgt/php.js: Value undefined (result of expression widget.system) is not object. (line: 3)

For those wondering if I actually included the

<key>AllowSystem</key>
<true/>

I did.

This is my info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AllowSystem</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>Integrator</string>
<key>CFBundleIdentifier</key>
<string>com.nicolasgoles.widget.Integrator</string>
<key>CFBundleName</key>
<string>Integrator</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CloseBoxInsetX</key>
<integer>15</integer>
<key>CloseBoxInsetY</key>
<integer>15</integer>
<key>Height</key>
<integer>192</integer>
<key>MainHTML</key>
<string>Integrator.html</string>
<key>Width</key>
<integer>330</integer>
</dict>
</plist>

Any help will be appreciated, I am a young developer, and I think widget coding is pretty interesting because of the widget.system method.

Thanks Smile
View user's profile Send private message Send e-mail 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