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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 196
Registered: ‎12-14-2009
My Device: Not Specified
Accepted Solution

I can't get a simple button with BBUI.js

Got this in my head:

 

<meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi" />
<link  rel="stylesheet" type="text/css" href="bbui-0.9.2.css"></link>
        <script type="text/javascript" src="bbui-0.9.2.js"></script>
<script language="javascript" type="text/javascript">
bb.init();

I package the css and js with my app.

 

I got this in the html body:

 

<div data-bb-type="button" onclick="alert('click');" data-bb-style="stretch" id="plain">My Button</div>

 Yet when I test the app it just shows the text My Button with no button around it to interact with. 

What am I doing wrong or not including?

 

Developer
Posts: 466
Registered: ‎04-11-2012
My Device: Bold 9900
My Carrier: Rogers

Re: I can't get a simple button with BBUI.js

try

 

 

<INPUT TYPE="button" class="bb-bb10-button-dark" Value="My Button" onclick="alert('click')" >

Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage. Please hit the like button below if what I said helped!
Developer
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900
My Carrier: Rogers

Re: I can't get a simple button with BBUI.js

I believe the step you are missing is to load your screen.

index.html

<html> 
<head>
<meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="bbui-0.9.2.css"></link>
<script type="text/javascript" src="bbui-0.9.2.js"></script>
<script type="text/javascript">
bb.init();
</script>
</head>
<body onload="bb.pushScreen('menu.html', 'menu');">
</body>
</html>

menu.html (from the above example, this is a separate .html file, no <html> or <body> tags needed):

<div data-bb-type="screen" data-bb-title="Test App" data-bb-effect="fade">
<div data-bb-type="button" onclick="alert('click');" id="plain">My Button</div>
</div>

Let me know if that doesn't work.

--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Developer
Posts: 196
Registered: ‎12-14-2009
My Device: Not Specified

Re: I can't get a simple button with BBUI.js

Thanks. But I tried that. I get the button but it is above the other screen. I want the buttons on the screen that I have textboxs with etc.

 

 

Developer
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900
My Carrier: Rogers

Re: I can't get a simple button with BBUI.js

All your content for each screen should be on the same html page. So if you have more content that goes with the button it should all be in menuh.tml (in my msg above), or whatever you called it.

Your index.html should not have much more than the example I gave, everything else should be in the screen pages when using bbUI.

If you still have trouble if you could post your full pages it would be much easier to help you out.
--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful