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
Highlighted
Developer
Posts: 25
Registered: ‎04-30-2011
My Device: Z10
My Carrier: AT&T
Accepted Solution

Window Covers in WebWorks app issue

I can not get the window covers to work in the app I created.

 

I have saw the post on github , but I am still not sure how it works.

 

I downloaded the boilerplate and built it, I still do not get what is going on.

 

Are there any very beginning documentation that I could read or even watch a video on?

 

This is a really cool feature that I would love to be able to use.

 

thanks in advance!

BlackBerry Development Advisor
Posts: 761
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: Window Covers in WebWorks app issue

Hi there,

 

Did you try the WindowCovers sample on GitHub, or just the Boilerplate one?

 

I made a Window Covers one a while back that's a very simple sample. All it does is show you how to set a Window Cover so it's probably a bit easier to follow than the full-blown Boilerplate app.

 

If you're building your app with WebWorks 2.0 (Beta) use this sample: https://github.com/blackberry/BB10-WebWorks-Samples/tree/WebWorks-2.0/WindowCovers

 

If you're using WebWorks v1.x you can use this sample: https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/WindowCovers

 

 

Developer
Posts: 25
Registered: ‎04-30-2011
My Device: Z10
My Carrier: AT&T

Re: Window Covers in WebWorks app issue

I don't get where this is <script src="local:///chrome/webworks.js" type="text/javascript"></script>.

 

I can not seem to find that acutal library.

 

Would this code have to be present at the top of each of my pages of code? Or would it just be in the intial page?

 

 

Developer
Posts: 25
Registered: ‎04-30-2011
My Device: Z10
My Carrier: AT&T

Re: Window Covers in WebWorks app issue

or do you maybe have an example of this feature working alone in an app?

Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Window Covers in WebWorks app issue

That script is added into your project for you when you build the application. It's how WebWorks 2.0 works behind the scenes, and provides all the APIs and hooks into the platform, like Window Covers.

 

Try building the sample application as is, following the directions in the Readme. If you connect to that running application with WebInspector, you can trace the code in action and learn how it all fits together.

Tim Windsor
Open Source Technical Lead
Developer
Posts: 25
Registered: ‎04-30-2011
My Device: Z10
My Carrier: AT&T

Re: Window Covers in WebWorks app issue

This is the code I used, but it still seems like I am missing something. I am using Webwroks 1.0 not 2.0. I am not sure what I am missing here.

 

<!DOCTYPE html>
<html>
    <head>
        <title>Daniel Fast</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">

<script src="cordova.js"></script>

blackberry.ui.cover.setContent(blackberry.ui.cover.TYPE_IMAGE, {
    path: <images/cover.png>
});

blackberry.ui.cover.labels = [{
    label: "This is my label",
    size: 10,
    wrap: true
}];

blackberry.ui.cover.updateCover();
        
<link rel="stylesheet" href="jquery.mobile-1.4.1.min.css" />
<script src="js/jquery-1.9.1.min.js"></script>
<script src="jquery.mobile-1.4.1.min.js"></script>
    
    
    </head>
    <body>

<div data-role="page">

<div data-role="header" data-position="inline" data-theme="b">
    <h1>Daniel Fast</h1>
</div>

    
<div data-role="header">        


</div><!-- /footer -->

    <div data-role="content" >


        
<ul data-role="listview" data-theme="d">

    <li>
          <a href="tips.html" data-transition="slide" >
                <img src="images/tipjar.jpg" />
                <h3>Tips</h3>
                <p>Tips for a great fast</p>
          </a>
    </li>
    <li>
          <a href="breakfast.html" data-transition="slide">
                <img src="images/breakfast.jpg" />
                <h3>Breakfast</h3>
                <p>Creative Breakfast items for Daniel Fast</p>
          </a>
    </li>
    <li>
          <a href="lunchdinner.html" data-transition="slide">
                <img src="images/dinner.jpg" />
                <h3>Lunch/Dinner</h3>
                <p>Delicious Lunch or Dinner items for Daniel Fast</p>
          </a>
    </li>
    <li>
          <a href="snacks.html" data-transition="slide">
                <img src="images/snacks.jpg" />
                <h3>Snacks</h3>
                <p>Snacks for the in-between times</p>
          </a>
    </li>    

    <li>
          <a href="fastfood.html" data-transition="slide">
                <img src="images/fastfood.jpg" />
                <h3>Eating on the Go</h3>
                <p>Places to eat when out</p>
          </a>
    </li>

</ul>

    </div><!-- /content -->
    
</div><!-- /page -->

</body>
</html>

Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Window Covers in WebWorks app issue

That would be the issue then - Cordova.js is for WebWorks 2.0

 

You want local:///chrome/webworks.js for WebWorks 1.0.

 

Check out the WebWorks 1.0 sample source to see how that works: 

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

Tim Windsor
Open Source Technical Lead
Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Window Covers in WebWorks app issue

And make sure that you've added the feature tags to your config.xml file too - 

https://github.com/blackberry/BB10-WebWorks-Samples/blob/master/WindowCovers/config.xml#L36

Tim Windsor
Open Source Technical Lead
Developer
Posts: 25
Registered: ‎04-30-2011
My Device: Z10
My Carrier: AT&T

Re: Window Covers in WebWorks app issue

I tried plugging in the local:///chrome/webworks.js and still no dice...

 

any other ideas on what might be missing?

Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Window Covers in WebWorks app issue

Are those calls to blackberry.ui... and so on inside script tags, or just out on their own like that?

 

Have you tried connecting to the app using WebInspector to see if there are errors?

Tim Windsor
Open Source Technical Lead