Label"

From Documentation
m (Created page with 'init')
 
Line 1: Line 1:
init
+
{{ZKComponentReferencePageHeader}}
 +
 
 +
= Label =
 +
 
 +
*Demonstration: [http://www.zkoss.org/zkdemo/userguide/#f2 Label]
 +
*Java API: <javadoc>org.zkoss.zul.Label</javadoc>
 +
*JavaScript API: <javadoc directory="jsdoc">zul.wgt.LabelX</javadoc>
 +
 
 +
= Employment/Purpose =
 +
A label component represents a piece of text.
 +
 
 +
= Example =
 +
[[Image:label.png]]
 +
 
 +
<source lang="xml" >
 +
<window title="Label Demo" >
 +
<grid>
 +
    <rows>
 +
        <row>Label(normal): <label id="lb1"/></row>
 +
        <row>Label(color): <label id="lb2" style="color:red"/></row>
 +
        <row>Label(font): <label id="lb3" style="font-weight:bold"/></row>
 +
        <row>Label(size): <label id="lb4" style="font-size:14pt"/></row>
 +
        <row>Label(maxlength): <label id="lb5" maxlength="5"/></row>
 +
        <row>Label(pre): <label id="lb6" pre="true"/></row>
 +
        <row>input:
 +
            <textbox id="txt" rows="2"><attribute name="onChange">
 +
                    lb1.value=self.value;
 +
                    lb2.value=self.value;
 +
                    lb3.value=self.value;
 +
                    lb4.value=self.value;
 +
                    lb5.value=self.value;
 +
                    lb6.value=self.value;
 +
            </attribute></textbox>
 +
        </row>
 +
    </rows>
 +
</grid>
 +
</window>
 +
</source>
 +
 
 +
You can control how a label is displayed with the <tt>style</tt>, <tt>pre</tt> and <tt>maxlength</tt> Properties.
 +
 
 +
For example, if you specify <tt>pre</tt> to be <tt>true</tt>, all white spaces, such as new line, space and tab, are preserved.
 +
 
 +
[For ZK3 users]
 +
 
 +
The specification of display behavior about <tt>pre</tt>, <tt>maxlength</tt>, and <tt>multiline</tt> is slightly different in ZK3.
 +
Please refer to [[Form_and_Inputs#The_pre.2C_hyphen.2C_maxlength_and_multiline_Properties|ZK - Form and Inputs]].
 +
 
 +
 
 +
 
 +
=Supported events=
 +
 
 +
{| border="1" | width="100%"
 +
! <center>Name</center>
 +
! <center>Event Type</center>
 +
|-
 +
| None
 +
| None
 +
|}
 +
 
 +
=Supported Children=
 +
 
 +
*ALL
 +
 
 +
=Use cases=
 +
 
 +
{| border='1px' | width="100%"
 +
! Version !! Description !! Example Location
 +
|-
 +
| &nbsp;
 +
| &nbsp;
 +
| &nbsp;
 +
|}
 +
 
 +
=Version History=
 +
 
 +
{| border='1px' | width="100%"
 +
! Version !! Date !! Content
 +
|-
 +
| 5.0.1
 +
| 4/30/2010
 +
| Initialization
 +
|}
 +
 
 +
{{ZKComponentReferencePageFooter}}

Revision as of 22:36, 2 May 2010

Label

Employment/Purpose

A label component represents a piece of text.

Example

File:Label.png

 <window title="Label Demo" >
 <grid>
     <rows>
         <row>Label(normal): <label id="lb1"/></row>
         <row>Label(color): <label id="lb2" style="color:red"/></row>
         <row>Label(font): <label id="lb3" style="font-weight:bold"/></row>
         <row>Label(size): <label id="lb4" style="font-size:14pt"/></row>
         <row>Label(maxlength): <label id="lb5" maxlength="5"/></row>
         <row>Label(pre): <label id="lb6" pre="true"/></row>
         <row>input:
             <textbox id="txt" rows="2"><attribute name="onChange">
                     lb1.value=self.value;
                     lb2.value=self.value;
                     lb3.value=self.value;
                     lb4.value=self.value;
                     lb5.value=self.value;
                     lb6.value=self.value;
             </attribute></textbox>
         </row>
     </rows>
 </grid>
 </window>

You can control how a label is displayed with the style, pre and maxlength Properties.

For example, if you specify pre to be true, all white spaces, such as new line, space and tab, are preserved.

[For ZK3 users]

The specification of display behavior about pre, maxlength, and multiline is slightly different in ZK3. Please refer to ZK - Form and Inputs.


Supported events

Name
Event Type
None None

Supported Children

*ALL

Use cases

Version Description Example Location
     

Version History

Version Date Content
5.0.1 4/30/2010 Initialization



Last Update : 2010/05/02

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