Doublespinner"

From Documentation
(Created page with '{{ZKComponentReferencePageHeader}} = Doublespinner = *Demonstration: [http://www.zkoss.org/zkdemo/input/form_sample Spinner] *Java API: <javadoc>org.zkoss.zul.Doublespinner</ja…')
 
m ((via JWB))
 
(5 intermediate revisions by 4 users not shown)
Line 16: Line 16:
  
 
<source lang="xml" >
 
<source lang="xml" >
<window title="Double Spinner" border="normal" width="150px">
+
    <doublespinner step="0.5" />
    <doublespinner />
 
</window>
 
 
</source>
 
</source>
  
Line 37: Line 35:
  
 
=Properties=
 
=Properties=
 +
 +
== Format ==
 +
You are able to format the field by providing specifying the attribute with a formatting string. The default value is <code>null</code>.
 +
 +
<source lang="xml" >
 +
<doublespinner format="#,##0.##"/>
 +
</source>
 +
 +
  Since 8.5.2
 +
You can provide a locale to format the number by specify the String starts with "locale:"
 +
 +
<source lang="xml" >
 +
<doublespinner format="locale:zh-TW"/>
 +
</source>
 +
 
== Constraint ==
 
== Constraint ==
You could specify what value to accept for input controls by use of the <tt>constraint </tt>property.  
+
You could specify what value to accept for input controls by use of the <code>constraint </code>property.  
It could be a combination of <tt>no empty</tt> and the minimum and maximum to doublespinner.
+
It could be a combination of <code>no empty</code> and the minimum and maximum to doublespinner.
  
 
To specify two or more constraints, use comma to separate them as follows.
 
To specify two or more constraints, use comma to separate them as follows.
Line 67: Line 80:
 
=Supported Events=
 
=Supported Events=
  
{| border="1" | width="100%"
+
{| class='wikitable' | width="100%"
 
! <center>Name</center>
 
! <center>Name</center>
 
! <center>Event Type</center>
 
! <center>Event Type</center>
Line 78: Line 91:
 
=Supported Molds=
 
=Supported Molds=
 
Available molds of a component are defined in lang.xml embedded in zul.jar.
 
Available molds of a component are defined in lang.xml embedded in zul.jar.
{| border="1" | width="100%"
+
{| class='wikitable' | width="100%"
 
! <center>Name</center>
 
! <center>Name</center>
 
! <center>Snapshot</center>
 
! <center>Snapshot</center>
Line 95: Line 108:
 
=Use Cases=
 
=Use Cases=
  
{| border='1px' | width="100%"
+
{| class='wikitable' | width="100%"
 
! Version !! Description !! Example Location
 
! Version !! Description !! Example Location
 
|-
 
|-
Line 105: Line 118:
 
=Version History=
 
=Version History=
 
{{LastUpdated}}
 
{{LastUpdated}}
{| border='1px' | width="100%"
+
{| class='wikitable' | width="100%"
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-
 
| 5.0.6
 
| 5.0.6
| Dec.
+
| Dec. 2010
 
| add new component
 
| add new component
 
|}
 
|}

Latest revision as of 10:42, 12 January 2022


Doublespinner

Employment/Purpose

An edit box for holding a constrained double.

Example

ZKComRef Doublespinner.png

     <doublespinner step="0.5" />

In-place Editing

Fixed Width

<doublespinner width="100px" inplace="true" value="30" />

Dynamic Width

Because inplace editing function in ZK is pure client side action, so we can use client api to modify the width (server side do not need to know)

ZK Component Reference-Input-Spinner-inplace.jpg

<zk xmlns:c="client">
  <doublespinner inplace="true" value="240" width="30px" c:onFocus='this.setWidth("60px")' c:onBlur='this.setWidth("30px")' />
</zk>

Properties

Format

You are able to format the field by providing specifying the attribute with a formatting string. The default value is null.

<doublespinner format="#,##0.##"/>
 Since 8.5.2

You can provide a locale to format the number by specify the String starts with "locale:"

<doublespinner format="locale:zh-TW"/>

Constraint

You could specify what value to accept for input controls by use of the constraint property. It could be a combination of no empty and the minimum and maximum to doublespinner.

To specify two or more constraints, use comma to separate them as follows.

<doublespinner step="0.5" constraint="no empty,min -2.5 max 6.5"/>

If you prefer to display different message to the default one, you can append the error message to the constraint with a colon.

<doublespinner step="0.5" constraint="no empty,min -2.5 max 6.5: between -2.5 to 6.5"/>

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.
<doublespinner step="0.5" constraint="no empty,min -2.5 max 6.5: ${c:l('err.msg.doublespinner')}"/>

Inherited Functions

Please refer to NumberInputElement for inherited functions.

Supported Events

Name
Event Type
None None

Supported Molds

Available molds of a component are defined in lang.xml embedded in zul.jar.

Name
Snapshot
default
Spinner mold default.png
rounded
Spinner mold rounded.png

Supported Children

*None

Use Cases

Version Description Example Location
     

Version History

Last Update : 2022/01/12


Version Date Content
5.0.6 Dec. 2010 add new component



Last Update : 2022/01/12

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.