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
Contributor
andyolivares
Posts: 14
Registered: ‎04-28-2010
My Device: None
Accepted Solution

Can not compile BB Widget with Custom JavaScript Extension

Hi:

 

I've came across the whole video about creating a custom Javascript Extension for BB Widgets and made my own. I made some functions avalaible and named my main package as "rgpackage" and that's where all my classes reside.

 

After doing that, I exported everything to a JAD/JAR file (just like the video says).

 

Opened up the BlackBerry Web Plug-in (v2.0.0.201003191451-33) and made a new BB Widget Project.

A new ext folder appeared and I dragged my JAR/JAD file into that folder.

 

Went to the config.xml in the default BB Widget Config Editor and added a feature. Mine appeared in the list so I double clicked on it.

 

Everything fine by now. Just added some code to my main index.html file to test my extension.

 

When hit the "Run" button, my widget started to compile (and also the extension) and this message keeps appearing (and I can't get rid of it... at least I don't know how and what could have happened):

 

[INFO]              Compiling widget
C:\Users\Andy\AppData\Local\Temp\widgetGen.3461070221272448531372.tmp\blackberry\web\widget\autogen\WidgetConfigAutoGen.java:27: package rgpackage does not exist
        _widgetExtensions.addElement(new rgpackage.RGPhotoTakerExtension());

 

Please help as I can't move on with the development because of this (weird?) error.

 

Thank you in advance.

 

Andy

Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Can not compile BB Widget with Custom JavaScript Extension

Can you post up the contents of your library.xml file for the widget extension?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
andyolivares
Posts: 14
Registered: ‎04-28-2010
My Device: None

Re: Can not compile BB Widget with Custom JavaScript Extension

Sure... here it is:

 

<?xml version="1.0" encoding="UTF-8"?>
<library>
    <extension>
        <entryClass>rgpackage.RGPhotoTakerExtension</entryClass>
    </extension>
    <features>
        <feature id="redglobal" version="1.0.0">RedGlobal PhotoTaker Javascript Extensions</feature>
    </features>
</library>

 

Thank you for your help :smileyhappy:

Contributor
andyolivares
Posts: 14
Registered: ‎04-28-2010
My Device: None

Re: Can not compile BB Widget with Custom JavaScript Extension

Any ideas? :smileyhappy:

Contributor
andyolivares
Posts: 14
Registered: ‎04-28-2010
My Device: None

Re: Can not compile BB Widget with Custom JavaScript Extension

I thought my extension had something wrong unabling it to compile properly, so I made the AlertSample extension from the video tutorial line by line, character by character, identically. I followed EVERY step just like mentioned in the video. I even downloaded the BB Widget Plug-in for Visual Studio 2008 and tried with it (just like the video tutorial). Added my newly created AlertSample extension to my VS 2008 BB Widget Project, modified the config.xml as stated by the video tutorial and afert pressing the "play" button in Visual Studio I get the same old error:

 

Message    7    C:\Users\Andy\AppData\Local\Temp\widgetGen.19565881831272522145887.tmp\blackberry\web\widget\autogen\WidgetConfigAutoGen.java:37: package widgetpackage does not exist    bbwp.exe    0    1    alertWidget

 

No idea what could be wrong. I even uninstalled everything, deleted every folder ever made by RIM in my computer and started over with a clean installation.

 

I really need some help with this.

 

BTW, my computer has Windows 7 32-bit installed.

 

Any help would be greatly appreciated.

 

Andy

Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Can not compile BB Widget with Custom JavaScript Extension

I\'m wondering if it could be a Win7 UAC issue. Is your widget archive or project located in a directory that is protected by UAC? Have you tried taking the Alert sample jar file itself from the lab material and use it in your widget? I\'m just wondering if there are some restrictive file permissions on your extension jar or it is marked readonly.
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
andyolivares
Posts: 14
Registered: ‎04-28-2010
My Device: None

Re: Can not compile BB Widget with Custom JavaScript Extension

I have UAC disabled in my computer. :-S

Contributor
andyolivares
Posts: 14
Registered: ‎04-28-2010
My Device: None

Re: Can not compile BB Widget with Custom JavaScript Extension

Hi again... tried the same excercise in two additional computers (one with Windows 7 32-bit and the other one with Windows XP SP2) and the same problem appeared in both.

 

This is really driving me crazy. What am I doing wrong? I'm doing the exact steps as the video tutorial.

 

Please help,

 

Andy

Contributor
andyolivares
Posts: 14
Registered: ‎04-28-2010
My Device: None

Re: Can not compile BB Widget with Custom JavaScript Extension

Trying to get this working finally found the problem.

 

For anyone's reference:

 

When exporting to JAR file, the option "Export Java source files and resources" should be selected, instead of "Export generated class files and resources". In my Eclipse, the last one was selected by default.

 

Unfortunately, the video tutorial is not clear on this point. Anyway, you can see in the video that the correct option is selected, but because it is not mentioned, it could lead to confusion like it occurred to me.

 

But now, everything is working as expected. Finally! :smileyhappy:

 

Thank's to everyone.

 

Andy

Contributor
calebhamilton
Posts: 15
Registered: ‎04-01-2011
My Device: Droid 1

Re: Can not compile BB Widget with Custom JavaScript Extension

Great find man. This has helped me progress with this confusing process quite a bit.

Caleb Hamilton | Metova
www.metova.com