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
r4md4c
Posts: 9
Registered: ‎08-15-2012
My Device: Bold 9900
My Carrier: Etisalat
Accepted Solution

TypeError: Result of expression 'new blackberry.invoke' [undefined] is not an object. In bbUI application

I am facing an error when using blackberry.invoke feature and blackberry,invoke.BrowserArguments

 

I have a group of items in an imageList an item is defined like this line

 

<div data-bb-type="item" onclick="openUptownCairoLink()" data-bb-img="" data-bb-title="Uptown Cairo">Minutes from Anywhere</div>

 

function openUptownCairoLink() {

try{

        var args = new blackberry.invoke.BrowserArguments('http://blackberry.com');

 blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);

  }catch(e){ alert(e) }

}

 

and when I click the item it alerts the error as in the subject of this topic.

 

I am using BB Bold 9900 with OS 7

 

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: TypeError: Result of expression 'new blackberry.invoke' [undefined] is not an object. In bbUI application

Can you post up your config.xml file... can you also specify the domain that this content is loaded into?

 

i.e. is this a local page in the appliation? or is it brought in from a different domain?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Contributor
r4md4c
Posts: 9
Registered: ‎08-15-2012
My Device: Bold 9900
My Carrier: Etisalat

Re: TypeError: Result of expression 'new blackberry.invoke' [undefined] is not an object. In bbUI application

<widget xmlns:rim="http://www.blackberry.com/ns/widgets" version="0.9.1.1" rim:header="RIM-Widget:rim/widget" xmlns="http://www.w3.org/ns/widgets">

  <rim:navigation mode="focus" />

  <name>Emaar</name>

  <description>Emaar Misr Privilege Program</description>

  <author>Swipe 'n Tap</author>

  

  <access subdomains="true" uri="*" />

  

  <rim:cache disableAllCache="true"/>

  

   <icon rim:hover="false" src="images/icon.png" />

   <icon rim:hover="true" src="images/icon.png" />

    

    

    

    <rim:loadingScreen backgroundColor="#CFCFCF"

        backgroundImage="images/Splash.jpg"

        onFirstLaunch="true">

        <rim:transitionEffect type="fadeOut" />

    </rim:loadingScreen>

 

  <content src="http://192.168.0.140:8888/Emaar/www/index.htm" />

  <feature id="blackberry.push" />

  <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.invoke.BrowserArguments" />

  <feature id="blackberry.invoke.PhoneArguments" />

  <feature id="blackberry.invoke" />

  <feature id="blackberry.app.event"/>

</widget>

 

 

Here is my config.xml file and I am loading the index.htm from external domain so that the development could be faster instead of each time blackberry reloads itself when a new version is installed.

 

So if that is the problem how can I enable the same features for the external domain ? 

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: TypeError: Result of expression 'new blackberry.invoke' [undefined] is not an object. In bbUI application

You will want to do the following:

 

<access uri="http://192.168.0.140:8888" subdomains="true">
  <feature id="blackberry.push" />
  <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.invoke.BrowserArguments" />
  <feature id="blackberry.invoke.PhoneArguments" />
  <feature id="blackberry.invoke" />
  <feature id="blackberry.app.event"/>
</access>

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.