Hi All,
The interaction from C++ sections to JavaScript sections and vice
versa can be done through this sequence of operations:
//calling JS method from c++ section;
//intitialising for webview and setting delegates
Context* context = Context::create();
Window* window = Window::create(context);
wstring script(L"getData();");
window->executeJavascript(WideString::point_to(script));
//calling C++ from JS sections
java script method inside xml file
getData(data)
{
var = "myFunction"
var += '<'
var += data
var += '>'
onConsole(var);
}
on callback implement onConsole method for WindowDelegate object
class Listener : public WindowDelegate
{
virtual void onConsoleMessage(Window * win,
WideString message,WideString sourceId,int line_no)
{
//here message contains c++ methods and data from Java Script
segregate data from method name wchih is enclosed within <> tag
}
All the best. Sorry i cannot post all the implementation, as we are
committed to client.
Regards,
Lenin