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
New Contributor
ssshake
Posts: 6
Registered: ‎01-27-2013
My Device: Z10, 9900
My Carrier: telus, bell

Help me with windowcover/active frames for a webworks app on bb10

[ Edited ]

Hi there, For the life of me I cannot get the windowcover functionality to update active frames for any of my webworks apps/demos.

 

I used example seen on the internet and the API documentation with no luck. I have purposefully tried to get this to work on a vanilla test app, to make sure my existing code wasn't messing with it somehow.

 

I've literally spent hours trying different things with no luck. I'm certain I must be missing something fundamental here.

 

For the record I'm not exactly new to stuff like this, but in particular to the blackberry elements Im certainly learning as I go.

 

I'm wondering if someone can post a known working example for me to validate against. By post I mean can someone please post a zip of their example so that I may review the entire source. Rather than code snippets which leave me prone to my own mistakes, I would like to see that yes this does work and then spend time to educate myself on what I was missing.

 

This is the information I'm working off of:

 

API: https://developer.blackberry.com/html5/apis/blackberry.ui.cover.html

 

DEMO on GIT: https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/WindowCovers

 

Forum post: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/New-Window-Cover-Active-Frame-AP...

 

The demo leaves me with a blank white screen. Through some troubleshooting it looks like this line executes:

 

document.addEventListener("webworksready", initApp());

 

but errors out within the function:

 

function initApp() {
    cover = new Object();

alert("test"); //executes

    // reset the cover settings upon maximizing the app
    blackberry.event.addEventListener("exitcover", function() {
        blackberry.ui.cover.resetCover();
    });
alert("test1"); //doesn't execute
    bb.pushScreen('app.html','app');
}

 

You can see I threw in some alerts as a sloppy way of troubleshooting

 

I enabled web inspector for the build but maybe web inspector is messed up on my version because no debugging data seems to get displayed in it. As in I see the buttons etc, but nothing happens.

 

 

Please use plain text.
New Contributor
ssshake
Posts: 6
Registered: ‎01-27-2013
My Device: Z10, 9900
My Carrier: telus, bell

Re: Help me with windowcover/active frames for a webworks app on bb10

[ Edited ]

Also I forgot, I want to describe my build process incase there's an issue there.

 

I'm using ripple to build the zip file, I don't have it sign and deploy a bar, because I was too lazy to set up the config for that.

 

I then take the zip, and use the blackberry graphical aid to build and sign the package. This seems to work fine for what I've built so far.

 

This is the inspector log in chrome, IF that's helpful at all.

 


 

Uncaught ReferenceError: blackberry is not defined app.js:22

Ripple :: Environment Warming Up (Tea. Earl Gray. Hot.) ripple.js:36

webworks.bb10 :: Initialization Finished (Make it so.) ripple.js:36

eula response:  true ripple.js:46

Uncaught Error: Cannot register a handler for the exitcover event, because it does not seem to be supported. ripple.js:40

webworks.bb10 :: fired webworksready event! ripple.js:36

Uncaught SyntaxError: Unexpected end of input index.html:1

Failed to load resource http://localhost:8472/extensions/get/?hash=55c15f33abcc3a30ac22697dd1c4d465&version=1.0.4.7

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 619
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: Help me with windowcover/active frames for a webworks app on bb10

Hello,

 

I tested the sample app on the latest WebWorks SDK and it is still working.

 

If you package that sample app from GitHub, it should work just fine.

 

Could you confirm that you're using the latest SDK v1.0.4.7?  As well, you may want to try using Ripple to package https://developer.blackberry.com/html5/documentation/getting_started_with_ripple_1866966_11.html

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
New Contributor
ssshake
Posts: 6
Registered: ‎01-27-2013
My Device: Z10, 9900
My Carrier: telus, bell

Re: Help me with windowcover/active frames for a webworks app on bb10

So it turns out I'm this is completely my fault. The problem became more evident when I tried to install the sdk, graphical aid and ripple from scratch on another computer. Somehow I was managing to package this with tabletOS SDK because I did a poor job of distiguishing DIR names of each SDK.

 

Thank you.

Please use plain text.
New Contributor
ssshake
Posts: 6
Registered: ‎01-27-2013
My Device: Z10, 9900
My Carrier: telus, bell

Re: Help me with windowcover/active frames for a webworks app on bb10

Lastly, off topic but if you don't mind can you tell me this?

 

Is there a way to reference a URL instead of a local image?

 

blackberry.ui.cover.setContent(blackberry.ui.cover.TYPE_IMAGE, {
        path: "http://images.wikia.com/finalfantasy/images/archive/8/85/20090719204056!Blackmage-ff1-nes.png"
    });

 

This doesnt work as an example. I have currently written a functioning app that montiors my home's IP cameras. What I'm trying to do here is set up the window cover to cycle through images of my cameras.

 

IF I cannot reference urls, I suppose my option is to save the images to the device and then reference it locally?

 

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 619
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: Help me with windowcover/active frames for a webworks app on bb10

I've never tried to be honest.  I would say, give it a shot, if it doesn't work than I think you're right,  download the image, then set it all the window cover.

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
New Contributor
nihilityify
Posts: 6
Registered: ‎03-31-2012
My Device: bb22
My Carrier: 33

Re: Help me with windowcover/active frames for a webworks app on bb10

[ Edited ]

can ripple support blackberry.ui.cover.TYPE_IMAGE?

 

Please use plain text.