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

Posts: 93
Registered: ‎08-18-2011
My Device: 9550
My Carrier: At&T

How to call C++ method from webView.evaluateJavaScript()?

Hi Guys,


I want to grab user credentials from webview and save it in C++ class. I implemented code as bellow:


webView.evaluateJavaScript("function getMyElement(name) {"+


" var x = document.getElementsByName(name);"+


" if(x.length > 0) {"+


" x = x[0].value;"+


" } else { "+


" x = null;"+


" }"+


" return x;"+


"}"+ securityApp.onUserCredintialRetrived(+"getMyElement('USER')"));


In .c++ class "securityApp.onUserCredintialRetrived(QString USER)" allows receiving "NaN".


What is the right way to call a c++ method from webView.evaluateJavaScript() method?



Shwarup Biswas