summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls
diff options
context:
space:
mode:
authorxue <>2006-04-26 21:18:01 +0000
committerxue <>2006-04-26 21:18:01 +0000
commit8ab196ce6c2d5de323bdd8ebcc11a73814c0cdca (patch)
treee77b1306648d03920439290bb8f3e27821410804 /demos/quickstart/protected/pages/Controls
parent5ba6cd4be568f686d890835a77586077cde1a943 (diff)
Merge from 3.0 branch till 971.
Diffstat (limited to 'demos/quickstart/protected/pages/Controls')
-rw-r--r--demos/quickstart/protected/pages/Controls/DatePicker.page75
-rw-r--r--demos/quickstart/protected/pages/Controls/Literal.page6
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TDatePicker/Home.page61
-rw-r--r--demos/quickstart/protected/pages/Controls/Standard.page4
-rw-r--r--demos/quickstart/protected/pages/Controls/Validation.page28
5 files changed, 166 insertions, 8 deletions
diff --git a/demos/quickstart/protected/pages/Controls/DatePicker.page b/demos/quickstart/protected/pages/Controls/DatePicker.page
index 5425f2ab..17d28382 100644
--- a/demos/quickstart/protected/pages/Controls/DatePicker.page
+++ b/demos/quickstart/protected/pages/Controls/DatePicker.page
@@ -3,8 +3,81 @@
<h1>TDatePicker</h1>
<com:DocLink ClassPath="System.Web.UI.WebControls.TDatePicker" />
+<p><tt>TDatePicker</tt> displays a text box for date input purpose.
+When the text box receives focus, a calendar will pop up and users can
+pick up from it a date that will be automatically entered into the text box.
+The format of the date string displayed in the text box is determined by
+the <tt>DateFormat</tt> property. Valid formats are the combination of the
+following tokens:
+
+<com:TTextHighlighter Language="text" CssClass="source">
+Character Format Pattern (en-US)
+---------------------------------------------------------------------
+ d day digit
+ dd padded day digit e.g. 01, 02
+ M month digit
+ MM padded month digit
+ MMM localized abbreviated month names, e.g. Mar, Apr
+ MMMM localized month name, e.g. March, April
+ yy 2 digit year
+ yyyy 4 digit year
+---------------------------------------------------------------------
+</com:TTextHighlighter>
+
+<p>
+The date of the date picker can be set using the <tt>Date</tt> or <tt>Timestamp</tt>
+properties. The <tt>Date</tt> property value must be in the same format as the pattern
+specified in the <tt>DateFormat</tt> property. The <tt>Timestamp</tt> property
+only accepts integers such as the Unix timestamp.
+</p>
+
<p>
-TBD
+TDatePicker has three <tt>Mode</tt> to show the date picker popup.
+ <ul>
+ <li><tt>Basic</tt> - Only shows a text input, focusing on the input shows the date picker.</li>
+ <li><tt>Button</tt> - Shows a button next to the text input, clicking on the button shows the date, button text can be by the <tt>ButtonText</tt> property.</li>
+ <li><tt>ImageButton</tt> - Shows an image next to the text input, clicking on the image shows the date picker, image source can be change through the <tt>ImageUrl</tt> property.</li>
+ </ul>
</p>
+<p>The <tt>CssClass</tt> property can be used to override the css class name
+for the date picker panel. The <tt>CalendarStyle</tt> property changes the overall calendar style.
+The following <tt>CalendarStyle</tt> values are available:
+ <ul>
+ <li><tt>default</tt> - The default calendar style.</li>
+ </ul>
+</p>
+
+<p>The <tt>InputMode</tt> property can be set to "TextBox" or "DropDownList" with
+default as "TextBox". In <tt>DropDownList</tt> mode, in addition to the popup date picker, three
+drop down list (day, month and year) are presented to select the date .
+When <tt>InputMode</tt> equals "DropDownList", the order and appearance of the date, month, and year
+will depend on the pattern specified in <tt>DateFormat</tt> property.
+</p>
+
+<p>The popup date picker can be hidden by specifying <tt>ShowCalendar</tt> as false. Much of the
+text of the popup date picker can be changed to a different language using the <tt>Culture</tt> property.
+</p>
+
+<p>The calendar picker year limit can be set using the <tt>FromYear</tt> and <tt>UpToYear</tt> properties
+where <tt>FromYear</tt> is the starting year and <tt>UpToYear</tt> is the last year selectable.
+The starting day of the week can be changed by the <tt>FirstDayOfWeek</tt> property, with 0 as Sunday, 1 as Monday, etc.
+</p>
+
+<p><b>Note 1:</b> If the <tt>InputMode</tt> is "TextBox", the <tt>DateFormat</tt> should
+only <b>NOT</b> contain <code>MMM</code> or <code>MMMM</code> patterns. The
+server side date parser will not be able to determine the correct date if <code>MMM</code> or
+<code>MMMM</code> are used. When <tt>InputMode</tt> equals "DropDownList", all patterns can be used.</p>
+
+<p><b>Note 2:</b> When the <tt>TDatePicker</tt> is used together
+with a validator, the <tt>DateFormat</tt> property of the validator must be equal to
+the <tt>DateFormat</tt> of the <tt>TDatePicker</tt> <b>AND</b> must set <tt>DataType</tt>="Date"
+on the validator to ensure correct validation. See
+<a href="?page=Controls.Validation#TCompareValidator">TCompareValidator</a>,
+<a href="?page=Controls.Validation#TDataTypeValidator">TDataTypeValidator</a> and
+<a href="?page=Controls.Validation#TRangeValidator">TRangeValidator</a>
+for details.</p>
+
+<com:RunBar PagePath="Controls.Samples.TDatePicker.Home" />
+
</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Literal.page b/demos/quickstart/protected/pages/Controls/Literal.page
index d7b44aff..30a84880 100644
--- a/demos/quickstart/protected/pages/Controls/Literal.page
+++ b/demos/quickstart/protected/pages/Controls/Literal.page
@@ -5,7 +5,7 @@
<p>
<tt>TLiteral</tt> displays a static text on a Web page. <tt>TLiteral</tt> is similar to the <tt>TLabel</tt> control, except that the <tt>TLiteral</tt>
- * control does not allow child controls and has no style properties, such as <tt>BackColor</tt>, <tt>Font</tt>, etc.
+ * control has no style properties, such as <tt>BackColor</tt>, <tt>Font</tt>, etc.
</p>
<p>
@@ -13,6 +13,10 @@ The text displayed by <tt>TLiteral</tt> can be programmatically controlled by se
</p>
<p>
+<tt>TLiteral</tt> will render the contents enclosed within its component tag if <tt>Text</tt> is empty.
+</p>
+
+<p>
Be aware, if <tt>Encode</tt> is false, make sure <tt>Text</tt> does not contain unwanted characters that may bring security vulnerabilities.
</p>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDatePicker/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TDatePicker/Home.page
new file mode 100644
index 00000000..e563145d
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TDatePicker/Home.page
@@ -0,0 +1,61 @@
+<com:TContent ID="body">
+
+<h1>TDatePicker Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+ <td class="samplenote">Default TDatePicker</td>
+ <td class="sampleaction">
+ <com:TDatePicker />
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">Button Mode, <br />pre-selected date 20-10-2005</td>
+ <td class="sampleaction">
+ <com:TDatePicker Mode="Button" Date="20-10-2005"/>
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">InputMode="DropDownList", <br />custom DateFormat="yyyy/MMM"</td>
+ <td class="sampleaction">
+ <com:TDatePicker DateFormat="yyyy/MMM" InputMode="DropDownList"/>
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">InputMode="DropDownList", <br/>custom DateFormat="MMM/yyyy", <br/>Culture="fr"</td>
+ <td class="sampleaction">
+ <com:TDatePicker DateFormat="MMM/yyyy" Culture="fr" InputMode="DropDownList"/>
+ </td>
+</tr>
+
+
+<tr>
+ <td class="samplenote">Custom DateFormat="日期:yyyy年M月d日", <br/>culture="zh_CN", <br />ImageButton mode, <br />pre-selected using Timestamp=&lt;%= @strtotime("-1 year") %&gt;</td>
+ <td class="sampleaction">
+ <com:TDatePicker Mode="ImageButton" Culture="zh_CN"
+ DateFormat="日期:yyyy年M月d日"
+ Timestamp=<%= @strtotime("-1 year") %>/>
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">Custom DateFormat="yyyy/MMMM/dd", <br />DropDownList, <br />pre-selected Date="2005/05/15"</td>
+ <td class="sampleaction">
+ <com:TDatePicker DateFormat="yyyy/MMMM/dd" Date="2005/05/15" InputMode="DropDownList"/>
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">DropDownList, <br />pre-selected date Timestamp=&lt;%= @strtotime("-1 month") %&gt;</td>
+ <td class="sampleaction">
+ <com:TDatePicker InputMode="DropDownList" Timestamp=<%= @strtotime("-1 month") %>/>
+ </td>
+</tr>
+
+</table>
+
+</com:TContent> \ 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 9580a0d7..dfaee35b 100644
--- a/demos/quickstart/protected/pages/Controls/Standard.page
+++ b/demos/quickstart/protected/pages/Controls/Standard.page
@@ -15,7 +15,7 @@
<a href="?page=Controls.ColorPicker">TColorPicker</a> represents an input field taking color values via a color dialog.
</li>
- <li>*
+ <li>
<a href="?page=Controls.DatePicker">TDatePicker</a> represents an input field taking date values via a calendar dialog.
</li>
@@ -27,7 +27,7 @@
<a href="?page=Controls.FileUpload">TFileUpload</a> represents a file upload field. It allows users to upload a file to server.
</li>
- <li>
+ <li>*
<a href="?page=Controls.Head">THead</a> represents the &lt;head&gt; element on an HTML Web page. It is required by a PRADO page should it use themes.
</li>
diff --git a/demos/quickstart/protected/pages/Controls/Validation.page b/demos/quickstart/protected/pages/Controls/Validation.page
index 6fe87fd0..6d83af3d 100644
--- a/demos/quickstart/protected/pages/Controls/Validation.page
+++ b/demos/quickstart/protected/pages/Controls/Validation.page
@@ -26,14 +26,19 @@ Validators share a common set of properties, which are defined in the base class
<li><tt>Dynamic</tt> - the space for displaying the error message is NOT reserved. Therefore, showing up the error message will shift the layout of your page around (usually down).</li>
</ul>
</li>
+<li><tt>ControlCssClass</tt> - the Css class that is applied to the control being validated in case the validation fails.</li>
+<li><tt>FocusOnError</tt> - set focus at the validating place if the validation fails. Defaults to false.</li>
+<li><tt>FocusElementID</tt> - the ID of the HTML element that will receive focus if validation fails and <tt>FocusOnError</tt> is true.</li>
</ul>
+<a name="TRequiredFieldValidator"></a>
<h2>TRequiredFieldValidator</h2>
<p>
TRequiredFieldValidator ensures that the user enters some data in the specified input field. By default, TRequiredFieldValidator will check if the user input is empty or not. The validation fails if the input is empty. By setting <tt>InitialValue</tt>, the validator can check if the user input is different from <tt>InitialValue</tt>. If not, the validation fails.
</p>
<com:RunBar PagePath="Controls.Samples.TRequiredFieldValidator.Home" />
+<a name="TRegularExpressionValidator"></a>
<h2>TRegularExpressionValidator</h2>
<p>
TRegularExpressionValidator verifies the user input against a regular pattern. The validation fails if the input does not match the pattern. The regular expression can be specified by the <tt>RegularExpression</tt> property. Some commonly used regular expressions include:
@@ -58,7 +63,7 @@ Note, TRegularExpressionValidator only checks for nonempty user input. Use a TRe
</p>
<com:RunBar PagePath="Controls.Samples.TRegularExpressionValidator.Home" />
-<h2>TEmailAddressValidator</h2>
+<h2 id="TEmailAddressValidator">TEmailAddressValidator</h2>
<p>
TEmailAddressValidator verifies that the user input is a valid email address. The validator uses a regular expression to check if the input is in a valid email address format. If <tt>CheckMXRecord</tt> is true, the validator will also check whether the MX record indicated by the email address is valid, provided <tt>checkdnsrr()</tt> is available in the installed PHP.
</p>
@@ -66,7 +71,8 @@ TEmailAddressValidator verifies that the user input is a valid email address. Th
Note, if the input being validated is empty, TEmailAddressValidator will not do validation. Use a TRequiredFieldValidator to ensure the value is not empty.
</p>
<com:RunBar PagePath="Controls.Samples.TEmailAddressValidator.Home" />
-
+
+<a name="TCompareValidator"></a>
<h2>TCompareValidator</h2>
<p>
TCompareValidator compares the user input with a constant value specified by <tt>ValueToCompare</tt>, or another user input specified by <tt>ControlToCompare</tt>. The <tt>Operator</tt> property specifies how to compare the values, which includes <tt>Equal</tt>, <tt>NotEqual</tt>, <tt>GreaterThan</tt>, <tt>GreaterThanEqual</tt>, <tt>LessThan</tt> and <tt>LessThanEqual</tt>. Before comparison, the values being compared will be converted to the type specified by <tt>DataType</tt> listed as follows,
@@ -75,26 +81,40 @@ TCompareValidator compares the user input with a constant value specified by <tt
<li><tt>String</tt> - A string data type.</li>
<li><tt>Integer</tt> - A 32-bit signed integer data type.</li>
<li><tt>Float</tt> - A double-precision floating point number data type.</li>
-<li><tt>Currency</tt> - A decimal data type that can contain currency symbols.</li>
<li><tt>Date</tt> - A date data type. The date format can be specified by setting <tt>DateFormat</tt> property, which must be recognizable by <tt>TSimpleDateFormatter</tt>. If the property is not set, the GNU date syntax is assumed.</li>
</ul>
<p>
Note, if the input being validated is empty, TEmailAddressValidator will not do validation. Use a TRequiredFieldValidator to ensure the value is not empty.
</p>
+<p>
+<b>N.B.</b> If validating against a <a href="?page=Controls.DatePicker">TDatePicker</a> the <tt>DataType</tt> must be equal to "Date" and the <tt>DateFormat</tt> property of the validator must be equal to the <tt>DateFormat</tt> of the <a href="?page=Controls.DatePicker">TDatePicker</a>.
+</p>
<com:RunBar PagePath="Controls.Samples.TCompareValidator.Home" />
+<a name="TDataTypeValidator"></a>
<h2>TDataTypeValidator</h2>
<p>
TDataTypeValidator verifies if the input data is of specific type indicated by <tt>DataType</tt>. The data types that can be checked against are the same as those in TCompareValidator.
</p>
+<p>
+<b>N.B.</b> If validating against a <a href="?page=Controls.DatePicker">TDatePicker</a> the <tt>DataType</tt> must be equal to "Date" and the <tt>DateFormat</tt> property of the validator must be equal to the <tt>DateFormat</tt> of the <a href="?page=Controls.DatePicker">TDatePicker</a>.
+</p>
+
+
<com:RunBar PagePath="Controls.Samples.TDataTypeValidator.Home" />
+<a name="TRangeValidator"></a>
<h2>TRangeValidator</h2>
<p>
TRangeValidator verifies whether an input value is within a specified range. TRangeValidator uses three key properties to perform its validation. The <tt>MinValue</tt> and <tt>MaxValue</tt> properties specify the minimum and maximum values of the valid range. The <tt>DataType</tt> property specifies the data type of the value being validated. The value will be first converted into the specified type and then compare with the valid range. The data types that can be checked against are the same as those in TCompareValidator.
</p>
+<p>
+<b>N.B.</b> If validating against a <a href="?page=Controls.DatePicker">TDatePicker</a> the <tt>DataType</tt> must be equal to "Date" and the <tt>DateFormat</tt> property of the validator must be equal to the <tt>DateFormat</tt> of the <a href="?page=Controls.DatePicker">TDatePicker</a>.
+</p>
+
<com:RunBar PagePath="Controls.Samples.TRangeValidator.Home" />
+<a name="TCustomValidator"></a>
<h2>TCustomValidator</h2>
<p>
TCustomValidator performs user-defined validation (either server-side or client-side or both) on an input control.
@@ -118,7 +138,7 @@ function ValidationFunctionName(sender, parameter)
</com:TTextHighlighter>
<com:RunBar PagePath="Controls.Samples.TCustomValidator.Home" />
-
+<a name="TValidationSummary"></a>
<h2>TValidationSummary</h2>
<p>
TValidationSummary displays a summary of validation errors inline on a Web page, in a message box, or both.