diff -r 913c9751c067 -r 716254ccbcc0 org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-63F9FB97-9A0D-4DE4-A645-F3DB7DC39716.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-63F9FB97-9A0D-4DE4-A645-F3DB7DC39716.html Fri Mar 05 19:11:15 2010 -0800 @@ -0,0 +1,19 @@ + + +Using JavaScript controls

Using JavaScript controls

You can create JavaScript objects that contain the state and implement the behavior of a control. The controls take care of drawing themselves, including changing their appearance as a result of various state changes.

+

To create JavaScript controls

Create JavaScript to add screen controls. The following example adds a text box and a button.

var helloButton;
+var nameField;
+
+...
+    // Add a text box to the view
+    nameField = new TextField(null, "Enter your name");
+    mainView.addControl(nameField);
+    
+    // Add a button to the view
+    helloButton = new FormButton(null, "Say Hello!");
+    helloButton.addEventListener("ActionPerformed", helloButtonClicked);
+    mainView.addControl(helloButton);

Figure: Hello World widget

+
\ No newline at end of file