02-05-2011 08:34 AM
Hello everyone.
I downloaded the webwork example "apiDemo.zip". I compiled and deployed correctly, but when I execute the webwork doesn´t work.
The webwork is very simple, it only have one button and when the button is pressed it shows and alert message.
Someone have the some problem ? How to fix it ?
Thanks, kind regards.
Solved! Go to Solution.
02-05-2011 02:38 PM
Can you provide the URL for the apiDemo.zip file you downloaded?
Also, are you running the PlayBook Simulator on a Mac or a PC?
02-05-2011 08:15 PM
Hello Tim.
I downloaded "apiDemo.zip" from:
1º. Log in http://webcast.streamlogics.com/audience/index.asp
2º. Acces to the second webbinar.
(http://webcast.streamlogics.com/audience/auditoriu
3º. The url of the examples on the second webbinar is:
Then, you can download: WebCast2_samples.zip
Inside this file, you can see the folder called "webWorksAPI" and inside the "apiDemo.zip" file.
I am running the simulator on a Mac. The sketchPad example works perfect.
"apiDemo" is very simple, this is the code:
<html>
<head>
<title>WebWorks API</title>
<script type="text/javascript">
function showAbout()
{
var sAbout = "This is a BlackBerry WebWorks application!\n\n";
sAbout += blackberry.app.name + " “;
sAbout += blackberry.app.version + "\n";
sAbout += "By: " + blackberry.app.author + "\n";
sAbout += "(c): " + blackberry.app.copyright + "\n";
alert(sAbout);
}
</script>
</head>
<body>
<button onclick="showAbout()">About this application</button>
</body>
</html>
The button doesn´t work.
What´s the problem ?
Thanks, kind regards.
02-07-2011 02:50 AM
I don´t know how, but now the code works correctly.
(Maybe a javascript error).
Thanks.
03-28-2011 09:52 PM
i'm unable to get any of my onclick calls to work. do you know what changed? i even tried to use the apiDemo example, and i didn't get an alert. i'm on windows7. my code works when i run it in chrome, including the onclick functions. it just seems the functionality doesn't work for the simulator. any ideas? thanks!
03-29-2011 11:14 PM
I am having this problem as well. :'(
03-30-2011 06:29 AM
Did you put <feature id="blackberry.app" version="1.0.0"/> into your config.xml?
03-30-2011 07:53 AM - edited 03-30-2011 11:28 PM
***update: that did the trick! thanks!***
i was wondering why when compiling my app there was a warning that <feature> was missing... i'll have to try it out when i get home this evening. thanks!!!
03-30-2011 08:05 PM - edited 03-30-2011 10:59 PM
AHA! Turns out the onclick was working, my code to set the text of a span doesn't work on the playbook. No idea why. but my onclick was able to trigger an alert to display.
Edit: this wasn't my problem either. jQuery 1.5.1 doesn't work on playbook simulator. Grabbed jQuery 1.5 and it works fine. That was 2 days wasted...