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

Native Development

Reply
Contributor
NareshPalle
Posts: 27
Registered: ‎04-20-2012
My Device: non-BlackBerry user
My Carrier: My company
Accepted Solution

How to call cascades c++ function from javascript

Hi,

Is there any way to call Cascades c++ functions from javascript in bb10 cascades without using qml files. It is very important part of my application. 

 

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How to call cascades c++ function from javascript

Where is this JavaScript code running?

If it's in a WebView, then the docs document something where you can call "navigator.cascades.postMessage()" from JavaScript and on the other side (which could be C++) listen for the messageReceived() signal.

If it's not in a WebView, then where is it if not in QML?

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
NareshPalle
Posts: 27
Registered: ‎04-20-2012
My Device: non-BlackBerry user
My Carrier: My company

Re: How to call cascades c++ function from javascript

[ Edited ]

when i use messageRecieve() signal in connect function it is showing there is no such signal bb::cascades::WebView::messageReceived(QVariantMap &). 

how to use it

Please use plain text.
Contributor
NareshPalle
Posts: 27
Registered: ‎04-20-2012
My Device: non-BlackBerry user
My Carrier: My company

Re: How to call cascades c++ function from javascript

Thank you for reply. The issue is resloved using trail and error method. it is just a problem in syntax. actual syntax is messageReceived(const QVariantMap &) and i mistakenly have not used const keyword.

Please use plain text.