Timebox"
From Documentation
Jumperchen (talk | contribs) |
Jimmyshiau (talk | contribs) |
||
Line 24: | Line 24: | ||
+ | =Properties= | ||
− | + | == Format == | |
− | == | ||
Use ''a'' to signify it is ''am'' or ''pm''. The input string follows the formatting of the [http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html SimpleDateFormat]. | Use ''a'' to signify it is ''am'' or ''pm''. The input string follows the formatting of the [http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html SimpleDateFormat]. | ||
Line 39: | Line 39: | ||
</zk></source> | </zk></source> | ||
[Since 5.0.0] | [Since 5.0.0] | ||
+ | |||
+ | == Constraint == | ||
+ | You could specify what value to accept for input controls by use of the <tt>constraint </tt>property. | ||
+ | It could be <tt>no empty</tt>. | ||
+ | |||
+ | If you prefer to display different message to the default one, you can append the error message to the constraint with a colon. | ||
+ | |||
+ | <source lang="xml" > | ||
+ | <timebox constraint="no empty: cannot be empty"/> | ||
+ | </source> | ||
+ | |||
+ | Notes: | ||
+ | * The error message, if specified, must be the last element and start with colon. | ||
+ | * To support multiple languages, you could use the ?l? function as depicted in the '''Internationalization''' chapter. | ||
+ | |||
+ | <source lang="xml" > | ||
+ | <timebox constraint="no empty: ${c:l('err.time.required')}"/> | ||
+ | </source> | ||
+ | |||
=Inherited Functions= | =Inherited Functions= |
Revision as of 21:47, 2 December 2010
Timebox
- Demonstration: Date and Time
- Java API: Timebox
- JavaScript API: Timebox
- Style Guide: Timebox
Employment/Purpose
An edit box for holding a time (a java.util.Date Object) , but only Hour & Minute are used.
Example
<window title="Simple" width="300px" border="normal">
<timebox id="tb0"/>
</window>
Properties
Format
Use a to signify it is am or pm. The input string follows the formatting of the SimpleDateFormat.
Below is an example of using a within the format.
<zk>
<window title="Test">
<timebox cols="20" format="a hh:mm:ss"/>
</window>
</zk>
[Since 5.0.0]
Constraint
You could specify what value to accept for input controls by use of the constraint property. It could be no empty.
If you prefer to display different message to the default one, you can append the error message to the constraint with a colon.
<timebox constraint="no empty: cannot be empty"/>
Notes:
- The error message, if specified, must be the last element and start with colon.
- To support multiple languages, you could use the ?l? function as depicted in the Internationalization chapter.
<timebox constraint="no empty: ${c:l('err.time.required')}"/>
Inherited Functions
Please refer to FormatInputElement for inherited functions.
Supported Events
None | None |
- Inherited Supported Events: FormatInputElement
Supported Molds
Available molds of a component are defined in lang.xml embedded in zul.jar.
[Since 5.0.0] |
Supported Children
*NONE
Use Cases
Version | Description | Example Location |
---|---|---|
Version History
Version | Date | Content |
---|---|---|