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
Super Contributor
Meghasanghvi
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Java script function call from C++

Hi,

I want to call java script function from my .cpp file.

What is exact way to achieve this?

I added javascript inside the qml file.

 

Please use plain text.
Developer
Dredvard
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Re: Java script function call from C++

Not sure the best way to do this - but you could just make a signal (eg.  JavaCall)  and send it to the qml.  Then in the QML have a slot  (eg. onJavaCall) where you call the JavaScript.  You might have to send another signal back to cpp when you've complete the Java function if you want to do sequential execution.

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
Developer
ignites
Posts: 466
Registered: ‎04-11-2012
My Device: Bold 9900
My Carrier: Rogers

Re: Java script function call from C++

This is probably possible (as stated by poster above) but I think its probably more efficent to see if you can write the Javascript function in C++. :smileyhappy:


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!
Please use plain text.