If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Regular Contributor
Cesar_Vanatur
Posts: 76
Registered: ‎02-17-2010
My Device: Storm
My Carrier: Vodafone
Accepted Solution

[Playbook Simulator] Event onclick doesn´t work :( (apiDemo.zip example).

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.

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: [Playbook Simulator] Event onclick doesn´t work :( (apiDemo.zip example).

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?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Regular Contributor
Cesar_Vanatur
Posts: 76
Registered: ‎02-17-2010
My Device: Storm
My Carrier: Vodafone

Re: [Playbook Simulator] Event onclick doesn´t work :( (apiDemo.zip example).

Hello Tim.

 

 I downloaded "apiDemo.zip" from:

 

1º. Log in  http://webcast.streamlogics.com/audience/index.asp?eventid=49950807

2º. Acces to the second webbinar.

(http://webcast.streamlogics.com/audience/auditorium/index.asp)

 

3º.  The url of the examples on the second webbinar is:

http://webcast.streamlogics.com.edgesuite.net/audience/auditorium/resource_redirect.asp?eventid=1483...

 

  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.

 

 

Please use plain text.
Regular Contributor
Cesar_Vanatur
Posts: 76
Registered: ‎02-17-2010
My Device: Storm
My Carrier: Vodafone

Re: [Playbook Simulator] Event onclick doesn´t work :( (apiDemo.zip example).

I don´t know how, but now the code works correctly.

 

(Maybe a javascript error).

 

Thanks.

Please use plain text.
Developer
shanerooni
Posts: 39
Registered: ‎03-01-2011
My Device: PlayBook
My Carrier: AT&T

Re: [Playbook Simulator] Event onclick doesn´t work :( (apiDemo.zip example).

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!

Please use plain text.
New Contributor
raquor
Posts: 2
Registered: ‎03-29-2011
My Device: BlackBerry Playbook
My Carrier: Verizon

Re: [Playbook Simulator] Event onclick doesn´t work :( (apiDemo.zip example).

I am having this problem as well. :'(

Please use plain text.
New Developer
tausi0661
Posts: 11
Registered: ‎01-29-2011
My Device: Not Specified

Re: [Playbook Simulator] Event onclick doesn´t work :( (apiDemo.zip example).

Did you put <feature id="blackberry.app" version="1.0.0"/> into your config.xml?

Please use plain text.
Developer
shanerooni
Posts: 39
Registered: ‎03-01-2011
My Device: PlayBook
My Carrier: AT&T

Re: [Playbook Simulator] Event onclick doesn´t work :( (apiDemo.zip example).

[ Edited ]

***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!!!

Please use plain text.
New Contributor
raquor
Posts: 2
Registered: ‎03-29-2011
My Device: BlackBerry Playbook
My Carrier: Verizon

Re: [Playbook Simulator] Event onclick doesn´t work :( (apiDemo.zip example).

[ Edited ]

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...

Please use plain text.