diff options
author | xue <> | 2005-12-24 17:14:39 +0000 |
---|---|---|
committer | xue <> | 2005-12-24 17:14:39 +0000 |
commit | da3e4e99d6a2e3b2c9591d969cb63d61a6114eee (patch) | |
tree | 4010a24fa28e4878d23f8301c4b7b79b699be1b5 /demos/quickstart/protected/pages/chap3/HelloWorld.page | |
parent | 0401be173cd1f80785c09f3a1dfae79d54441197 (diff) |
Diffstat (limited to 'demos/quickstart/protected/pages/chap3/HelloWorld.page')
-rw-r--r-- | demos/quickstart/protected/pages/chap3/HelloWorld.page | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/chap3/HelloWorld.page b/demos/quickstart/protected/pages/chap3/HelloWorld.page new file mode 100644 index 00000000..8ded6585 --- /dev/null +++ b/demos/quickstart/protected/pages/chap3/HelloWorld.page @@ -0,0 +1,26 @@ +<com:TContent ID="body" >
+<h4>Sample: Hello World</h4>
+<p>
+"Hello World" is the simplest <i>interactive</i> PRADO application that you can build. It displays to end-users a page with a submit button whose caption is <i>Click Me</i>. When the user clicks on the button, the button changes the caption to <i>Hello World</i>.
+</p>
+<p>
+There are many approaches that can achieve the above goal. One can submit the page to the server, examine the POST variable, and generate a new page with the button caption updated. Or one can simply use JavaScript to update the button caption upon its <i>onclick</i> event.
+</p>
+<p>
+PRADO promotes component-based and event-driven Web programming. The button is represented by a <i>TButton</i> object. It encapsulates the button caption as the <i>Text</i> property and associates the user button click action with a server-side <i>Click</i> event. Therefore, the "Hello World" task can be handled intuitively and easily. One simply needs to attach a function to the button's <i>Click</i> event. Within the function, the button's <i>Text</i> property is modified as "Hello World". The following diagram shows the above sequence,
+</p>
+<img src="<%~HelloWorld/sequence.gif%>" />
+<p>
+The code that a developer needs to write is merely the following event handler function, where <code>$sender</code> refers to the button object.
+</p>
+<pre class="code">
+public function buttonClicked($sender,$param)
+{
+ $sender->Text="Hello World";
+}
+</pre>
+<div class="runbar">
+<a href="?page=chap3.HelloWorld.Home" target="_blank">Run Sample</a>
+<a href="?page=ViewSource&path=/chap3/HelloWorld/Home.php" target="_blank">View Source</a>
+</div>
+</com:TContent>
\ No newline at end of file |