diff options
author | xue <> | 2006-04-02 01:48:18 +0000 |
---|---|---|
committer | xue <> | 2006-04-02 01:48:18 +0000 |
commit | f826b0ae6b8f11f8da1a5a6251e9a1fe6e6c1e85 (patch) | |
tree | 74d1aa11100d867bebcc94d1d871d896df055087 /demos | |
parent | 3f003a625159217eddedeaa02c999f76f351525e (diff) |
Added TFileUpload and TJavascriptLogger tutorials.
Diffstat (limited to 'demos')
5 files changed, 83 insertions, 3 deletions
diff --git a/demos/quickstart/protected/pages/Controls/FileUpload.page b/demos/quickstart/protected/pages/Controls/FileUpload.page index 873d4bc7..8aa5a0fb 100644 --- a/demos/quickstart/protected/pages/Controls/FileUpload.page +++ b/demos/quickstart/protected/pages/Controls/FileUpload.page @@ -4,7 +4,24 @@ <com:DocLink ClassPath="System.Web.UI.WebControls.TFileUpload" />
<p>
-TBD
+<tt>TFileUpload</tt> displays a file upload field on a Web page. Upon postback, the text entered into the field will be treated as the (local) name of the file that is uploaded to the server.
</p>
+<p>
+<tt>TFileUpload</tt> raises an <tt>OnFileUpload</tt> event when it is post back. The property <tt>HasFile</tt> indicates whether the file upload is successful or not. If successful, the uploaded file may be saved on the server by calling <tt>saveAs()</tt> method.
+</p>
+<p>
+The following properties give the information about the uploaded file:
+</p>
+<ul>
+ <li><tt>FileName</tt> - the original client-side file name without directory information.</li>
+ <li><tt>FileType</tt> - the MIME type of the uploaded file.</li>
+ <li><tt>FileSize</tt> - the file size in bytes.</li>
+ <li><tt>LocalName</tt> - the absolute file path of the uploaded file on the server. Note, this file will be deleted after the current page request is completed. Call <tt>saveAs()</tt> to save the uploaded file.</li>
+</ul>
+<p>
+If the file upload is unsuccessful, the property <tt>ErrorCode</tt> gives the error code describing the cause of failure. See <a href="http://www.php.net/manual/en/features.file-upload.errors.php">PHP documentation</a> for a complete explanation of the possible error codes.
+</p>
+
+<com:RunBar PagePath="Controls.Samples.TFileUpload.Home" />
</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/JavascriptLogger.page b/demos/quickstart/protected/pages/Controls/JavascriptLogger.page index 8b3c63c8..cff2b7aa 100644 --- a/demos/quickstart/protected/pages/Controls/JavascriptLogger.page +++ b/demos/quickstart/protected/pages/Controls/JavascriptLogger.page @@ -3,4 +3,29 @@ <h1>TJavascriptLogger</h1>
<com:DocLink ClassPath="System.Web.UI.WebControls.TJavascriptLogger" />
+<p>
+<tt>TJavascriptLogger</tt> provides logging for client-side javascript. It is mainly a wrapper of the javascript developed at <a href="http://gleepglop.com/javascripts/logger/">http://gleepglop.com/javascripts/logger/</a>.
+</p>
+
+<p>
+To use <tt>TJavascriptLogger</tt>, simply place the following component tag in a page template.
+</p>
+<com:TTextHighlighter Language="prado" CssClass="source">
+<com:TJavascriptLogger />
+</com:TTextHighlighter>
+
+<p>
+Then, the client-side javascript may contain the following statements. When they are executed, they will appear in the logger window.
+</p>
+<com:TTextHighlighter Language="js" CssClass="source">
+Logger.info('something happend');
+Logger.warn('A warning');
+Logger.error('This is an error');
+Logger.debug('debug information');
+</com:TTextHighlighter>
+
+<p>
+To toggle the visibility of the logger and console on the browser window, press ALT-D (or CTRL-D on OS X).
+</p>
+
</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.page new file mode 100644 index 00000000..30168e1a --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.page @@ -0,0 +1,17 @@ +<com:TContent ID="body">
+
+<h1>TFileUpload Sample</h1>
+
+<p>
+Please choose a file to upload:
+</p>
+
+<com:TFileUpload OnFileUpload="fileUploaded" />
+
+<com:TButton Text="Upload" />
+
+<br/>
+
+<com:TLabel ID="Result" />
+
+</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.php new file mode 100644 index 00000000..d5cf990a --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TFileUpload/Home.php @@ -0,0 +1,21 @@ +<?php
+
+class Home extends TPage
+{
+ public function fileUploaded($sender,$param)
+ {
+ if($sender->HasFile)
+ {
+ $this->Result->Text="
+ You just uploaded a file:
+ <br/>
+ Name: {$sender->FileName}
+ <br/>
+ Size: {$sender->FileSize}
+ <br/>
+ Type: {$sender->FileType}";
+ }
+ }
+}
+
+?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page index af4d6877..9580a0d7 100644 --- a/demos/quickstart/protected/pages/Controls/Standard.page +++ b/demos/quickstart/protected/pages/Controls/Standard.page @@ -23,7 +23,7 @@ <a href="?page=Controls.Expression">TExpression</a> accepts a PHP expression and displays the evaluation result on a Web page.
</li>
- <li>*
+ <li>
<a href="?page=Controls.FileUpload">TFileUpload</a> represents a file upload field. It allows users to upload a file to server.
</li>
@@ -59,7 +59,7 @@ <a href="?page=Controls.InlineFrame">TInlineFrame</a> represents an <iframe> HTML element on a Web page.
</li>
- <li>*
+ <li>
<a href="?page=Controls.JavascriptLogger">TJavascriptLogger</a> represents a logger on a Web page that can log various JavaScript information.
</li>
|