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
Trusted Contributor
sergiosandoval
Posts: 132
Registered: ‎02-17-2012
My Device: Bold 9900

BB10 Action not working

[ Edited ]

I cant seem to get this button to open up the browser. when i press it is just sits there doing nothing.

 

 

Thanks in advanced

 

Htm code

<script>
function openBrowser() {
//change to your URL
   var url = "https://twitter.com/intent/tweet?button_hashtag=GetFit&text=Gettin'%20%23ripped%20with%20%23GetFit.%...";
   var args = new blackberry.invoke.BrowserArguments(url);
   blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
}

</script>

<div data-bb-type="screen" data-bb-effect="fade">
	

  <br />

    <center><img src="images/share1.png" />
    <img src="images/twitter.png" />
 </center>


	<div data-bb-type="action-bar" data-bb-tab-style="highlight">

<div data-bb-type="title" data-bb-caption="Terms" data-bb-back-caption="Back" ></div>

		<div data-bb-type="action" data-bb-style="tab" data-bb-img="images/share.png" onlick="openBrowser();">#GETFIT</div>
        
   
      
 <div data-bb-type="action" data-bb-style="button" data-bb-img="images/actionBar/exit.png" onclick="blackberry.app.exit();">Exit</div>
 


      </div>      
      </div>

 and here is my XML sheet

 

  <content src="index.html" />
  <access uri="https://twitter.com" subdomains="true">
  <feature id="blackberry.push" />
  <feature id="blackberry.message.sms" />
  <feature id="blackberry.ui.menu" />
  <feature id="blackberry.ui.dialog"/>
  <feature id="blackberry.identity" />
  <feature id="blackberry.system.event" />
  <feature id="blackberry.app" />
  <feature id="blackberry.app.event"/>
  <feature id="blackberry.invoke" /> 
  <feature id="blackberry.invoke.BrowserArguments" /> 
  <feature id="blackberry.identity" /> 
  
  <feature id="blackberry.ui.dialog" required="true" version="1.0.0"/>

   <feature id="blackberry.app.event" required="true" version="1.0.0"/>
</access>

 Thank You.

Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: BB10 Action not working

Did you try using Web Inspector to confirm whether you get a runtime error when you click on the button?  I might guess you are getting a "openBrowser not found" type of error.



You are using bbUI.js, yes?

 

I think the following JavaScript needs to be moved into an external resource, and linked to from within your screens HTML fragment.

 

Like this:

 

openbrowser.js

 

function openBrowser() {
//change to your URL
   var url = "https://twitter.com/intent/tweet?button_hashtag=GetFit&text=Gettin'%20%23ripped%20with%20%23GetFit.%...";
   var args = new blackberry.invoke.BrowserArguments(url);
   blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
}

 

 

index.htm

 

<div data-bb-type="screen" data-bb-effect="fade">
	<script id="openJS" src="openbrowser.js"></script>

...

</div>
	

 

 

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Trusted Contributor
sergiosandoval
Posts: 132
Registered: ‎02-17-2012
My Device: Bold 9900

Re: BB10 Action not working

That didnt work. Also my Exit buttons dont work now.