From 8b0c8f0d0557d8ab88409cd9691cd1ee279321d5 Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 25 Apr 2006 07:01:04 +0000 Subject: Complete #70, update TDateFormat, NumberFormat add zerofill. Update TDatePicker quickstart doc, I18N quickstart doc. --- .../protected/pages/Controls/DatePicker.page | 75 +++++++++++++++++++++- .../pages/Controls/Samples/TDatePicker/Home.page | 61 ++++++++++++++++++ .../protected/pages/Controls/Standard.page | 4 +- .../protected/pages/Controls/Validation.page | 28 ++++++-- 4 files changed, 161 insertions(+), 7 deletions(-) create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TDatePicker/Home.page (limited to 'demos/quickstart/protected/pages/Controls') 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 @@

TDatePicker

+

TDatePicker 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 DateFormat property. Valid formats are the combination of the +following tokens: + + +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 +--------------------------------------------------------------------- + + +

+The date of the date picker can be set using the Date or Timestamp +properties. The Date property value must be in the same format as the pattern +specified in the DateFormat property. The Timestamp property +only accepts integers such as the Unix timestamp. +

+

-TBD +TDatePicker has three Mode to show the date picker popup. +

+

The CssClass property can be used to override the css class name +for the date picker panel. The CalendarStyle property changes the overall calendar style. +The following CalendarStyle values are available: +

+

+ +

The InputMode property can be set to "TextBox" or "DropDownList" with +default as "TextBox". In DropDownList mode, in addition to the popup date picker, three +drop down list (day, month and year) are presented to select the date . +When InputMode equals "DropDownList", the order and appearance of the date, month, and year +will depend on the pattern specified in DateFormat property. +

+ +

The popup date picker can be hidden by specifying ShowCalendar as false. Much of the +text of the popup date picker can be changed to a different language using the Culture property. +

+ +

The calendar picker year limit can be set using the FromYear and UpToYear properties +where FromYear is the starting year and UpToYear is the last year selectable. +The starting day of the week can be changed by the FirstDayOfWeek property, with 0 as Sunday, 1 as Monday, etc. +

+ +

Note 1: If the InputMode is "TextBox", the DateFormat should +only NOT contain MMM or MMMM patterns. The +server side date parser will not be able to determine the correct date if MMM or +MMMM are used. When InputMode equals "DropDownList", all patterns can be used.

+ +

Note 2: When the TDatePicker is used together +with a validator, the DateFormat property of the validator must be equal to +the DateFormat of the TDatePicker AND must set DataType="Date" +on the validator to ensure correct validation. See +TCompareValidator, +TDataTypeValidator and +TRangeValidator +for details.

+ + + \ No newline at end of file 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 @@ + + +

TDatePicker Samples

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Default TDatePicker + +
Button Mode,
pre-selected date 20-10-2005
+ +
InputMode="DropDownList",
custom DateFormat="yyyy/MMM"
+ +
InputMode="DropDownList",
custom DateFormat="MMM/yyyy",
Culture="fr"
+ +
Custom DateFormat="日期:yyyy年M月d日",
culture="zh_CN",
ImageButton mode,
pre-selected using Timestamp=<%= @strtotime("-1 year") %>
+ /> +
Custom DateFormat="yyyy/MMMM/dd",
DropDownList,
pre-selected Date="2005/05/15"
+ +
DropDownList,
pre-selected date Timestamp=<%= @strtotime("-1 month") %>
+ /> +
+ +
\ 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 @@ TColorPicker represents an input field taking color values via a color dialog. -
  • * +
  • TDatePicker represents an input field taking date values via a calendar dialog.
  • @@ -27,7 +27,7 @@ TFileUpload represents a file upload field. It allows users to upload a file to server. -
  • +
  • * THead represents the <head> element on an HTML Web page. It is required by a PRADO page should it use themes.
  • 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
  • Dynamic - 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).
  • +
  • ControlCssClass - the Css class that is applied to the control being validated in case the validation fails.
  • +
  • FocusOnError - set focus at the validating place if the validation fails. Defaults to false.
  • +
  • FocusElementID - the ID of the HTML element that will receive focus if validation fails and FocusOnError is true.
  • +

    TRequiredFieldValidator

    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 InitialValue, the validator can check if the user input is different from InitialValue. If not, the validation fails.

    +

    TRegularExpressionValidator

    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 RegularExpression property. Some commonly used regular expressions include: @@ -58,7 +63,7 @@ Note, TRegularExpressionValidator only checks for nonempty user input. Use a TRe

    -

    TEmailAddressValidator

    +

    TEmailAddressValidator

    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 CheckMXRecord is true, the validator will also check whether the MX record indicated by the email address is valid, provided checkdnsrr() is available in the installed PHP.

    @@ -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.

    - + +

    TCompareValidator

    TCompareValidator compares the user input with a constant value specified by ValueToCompare, or another user input specified by ControlToCompare. The Operator property specifies how to compare the values, which includes Equal, NotEqual, GreaterThan, GreaterThanEqual, LessThan and LessThanEqual. Before comparison, the values being compared will be converted to the type specified by DataType listed as follows, @@ -75,26 +81,40 @@ TCompareValidator compares the user input with a constant value specified by String - A string data type.

  • Integer - A 32-bit signed integer data type.
  • Float - A double-precision floating point number data type.
  • -
  • Currency - A decimal data type that can contain currency symbols.
  • Date - A date data type. The date format can be specified by setting DateFormat property, which must be recognizable by TSimpleDateFormatter. If the property is not set, the GNU date syntax is assumed.
  • Note, if the input being validated is empty, TEmailAddressValidator will not do validation. Use a TRequiredFieldValidator to ensure the value is not empty.

    +

    +N.B. If validating against a TDatePicker the DataType must be equal to "Date" and the DateFormat property of the validator must be equal to the DateFormat of the TDatePicker. +

    +

    TDataTypeValidator

    TDataTypeValidator verifies if the input data is of specific type indicated by DataType. The data types that can be checked against are the same as those in TCompareValidator.

    +

    +N.B. If validating against a TDatePicker the DataType must be equal to "Date" and the DateFormat property of the validator must be equal to the DateFormat of the TDatePicker. +

    + + +

    TRangeValidator

    TRangeValidator verifies whether an input value is within a specified range. TRangeValidator uses three key properties to perform its validation. The MinValue and MaxValue properties specify the minimum and maximum values of the valid range. The DataType 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.

    +

    +N.B. If validating against a TDatePicker the DataType must be equal to "Date" and the DateFormat property of the validator must be equal to the DateFormat of the TDatePicker. +

    + +

    TCustomValidator

    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) - +

    TValidationSummary

    TValidationSummary displays a summary of validation errors inline on a Web page, in a message box, or both. -- cgit v1.2.3