An example showing how to interact custom JavaScript with Wt stuff.
More...
#include <JavascriptExample.h>
An example showing how to interact custom JavaScript with Wt stuff.
Definition at line 24 of file JavascriptExample.h.
◆ JavascriptExample()
JavascriptExample::JavascriptExample |
( |
const WEnvironment & |
env | ) |
|
Create the example application.
Definition at line 19 of file JavascriptExample.C.
22 setTitle(
"Javascript example");
40 new WText(
"<h2>Wt Javascript example</h2>"
41 "<p>Wt makes abstraction of Javascript, and therefore allows you"
42 " to develop web applications without any knowledge of Javascript,"
43 " and which are not dependent on Javascript."
44 " However, Wt does allow you to add custom Javascript code:</p>"
46 " <li>To call custom JavaScript code from an event handler, "
47 "connect the Wt::EventSignal to a Wt::JSlot.</li>"
48 " <li>To call C++ code from custom JavaScript, use "
49 "Wt.emit() to emit a Wt::JSignal.</li>"
50 " <li>To call custom JavaScript code from C++, use "
51 "WApplication::doJavascript() or Wt::JSlot::exec().</li>"
53 "<p>This simple application shows how to interact between C++ and"
54 " JavaScript using the JSlot and JSignal classes.</p>", root());
59 WPushButton *amountButton =
new WPushButton(
"Change ...", root());
60 amountButton->setMargin(10, Left | Right);
64 WPushButton *confirmButton =
new WPushButton(
"Pay now.", root());
65 confirmButton->setMargin(10, Top | Bottom);
◆ confirmed()
void JavascriptExample::confirmed |
( |
| ) |
|
|
private |
◆ setAmount()
void JavascriptExample::setAmount |
( |
std::string |
amount | ) |
|
|
private |
◆ confirmPay_
Popup* JavascriptExample::confirmPay_ |
|
private |
◆ currentAmount_
WText* JavascriptExample::currentAmount_ |
|
private |
◆ promptAmount_
Popup* JavascriptExample::promptAmount_ |
|
private |
The documentation for this class was generated from the following files: