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
Developer
Posts: 25
Registered: ‎12-21-2009
My Device: BlackBerry Z10
My Carrier: Verizon
Accepted Solution

New Window Cover (Active Frame) API File Path Help

I am still learning, but I can not figure out how to pass the location of my active frame image to the new window cover api.  Here is my function that is called from the entercover event listener.  The image is a jpg located in the images folder of my webworks application.  Any ideas?

 

<script type="text/javascript">

function onEnterCover() {

var coverOptions = {"path": "images/active_frame.jpg"};

blackberry.ui.cover.setContent(blackberry.ui.TYPE_IMAGE, coverOptions);

blackberry.ui.cover.updateCover();

}
blackberry.event.addEventListener("entercover", onEnterCover); </script>
BlackBerry Development Advisor
Posts: 115
Registered: ‎06-06-2011
My Device: 9800
My Carrier: Rogers

Re: New Window Cover (Active Frame) API File Path Help

Few things to note -


Also you don't need wait till you entercover. You can do this anytime and entercover is just for you to know when the cover is about to go on so you can start an interval or something if you want to update it with information from you server

path needs to be a full path
"file:///accounts/1000/shared/downloads/windowcover.png"

If you want a local file path you can use ( for files in your content)

"local:///images/active_frame.jpg"

I don't have complete samples yet but you can have a look at our test cases

local file path -
https://github.com/blackberry/BB10-WebWorks-Framework/blob/master/test/functional/manual/blackberry....

https://github.com/blackberry/BB10-WebWorks-Framework/blob/master/test/functional/manual/blackberry....

Samples should be coming soon.




@nukulb
BlackBerry Development Advisor
Posts: 115
Registered: ‎06-06-2011
My Device: 9800
My Carrier: Rogers

Re: New Window Cover (Active Frame) API File Path Help

Developer
Posts: 25
Registered: ‎12-21-2009
My Device: BlackBerry Z10
My Carrier: Verizon

Re: New Window Cover (Active Frame) API File Path Help

Thank you Nukul!  I appreciate the help!