Center"

From Documentation
m ((via JWB))
 
(14 intermediate revisions by 5 users not shown)
Line 3: Line 3:
 
= Center =
 
= Center =
  
*Demonstration: [http://www.zkoss.org/zkdemo/userguide/#l1 Borderlayout]  
+
*Demonstration: [http://www.zkoss.org/zkdemo/layout/border_layout Borderlayout]
 
*Java API: <javadoc>org.zkoss.zul.Center</javadoc>
 
*Java API: <javadoc>org.zkoss.zul.Center</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zul.layout.Center</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zul.layout.Center</javadoc>
 +
*Style Guide: [[ZK_Style_Guide/XUL_Component_Specification/Borderlayout/Default_(Center)|Center]]
  
 
= Employment/Purpose =
 
= Employment/Purpose =
  
This component is a center region. The default class of CSS is specified "layout-region-center".  
+
A center region of a border layout and only allows one component as its child.
 
 
  
 
= Example =
 
= Example =
  
[[Image:ZKComRef_South_Example.jpg]]  
+
[[Image:ZKCompRef_Borderlayout.jpg]]  
  
 
<source lang="xml" >
 
<source lang="xml" >
<borderlayout height="500px">
+
<borderlayout height="450px">
    <north size="50%" border="0">
+
<north title="North" maxsize="300" size="50%" splittable="true" collapsible="true">
        <borderlayout>
+
<borderlayout>
            <west size="25%" border="none" flex="true">
+
<west title="West" size="25%" flex="true" maxsize="250" splittable="true" collapsible="true">
                <div style="background:#B8D335">
+
<div style="background:#B8D335">
                    <label value="25%"
+
<label value="25%"
                        style="color:white;font-size:50px" />
+
style="color:white;font-size:50px" />
                </div>
+
</div>
            </west>
+
</west>
            <center border="none" flex="true">
+
<center border="none">
                <div style="background:#E6D92C">
+
<div style="background:#E6D92C" vflex="1">
                    <label value="25%"
+
<label value="25%"
                        style="color:white;font-size:50px" />
+
style="color:white;font-size:50px" />
                </div>
+
</div>
            </center>
+
</center>
            <east size="50%" border="none" flex="true">
+
<east size="50%" border="none">
                <label value="Here is a non-border"
+
<label value="Here is a non-border"
                    style="color:gray;font-size:30px" />
+
style="color:gray;font-size:30px" />
            </east>
+
</east>
        </borderlayout>
+
</borderlayout>
    </north>
+
</north>
    <center border="0">
+
<center border="0">
        <borderlayout>
+
<borderlayout>
            <west size="30%" flex="true" border="0">
+
<west maxsize="600" size="30%" border="0" splittable="true">
                <div style="background:#E6D92C">
+
<div style="background:#E6D92C" vflex="1">
                    <label value="30%"
+
<label value="30%"
                        style="color:white;font-size:50px" />
+
style="color:white;font-size:50px" />
                </div>
+
</div>
            </west>
+
</west>
            <center>
+
<center>
                <label value="Here is a border"
+
<label value="Here is a border"
                    style="color:gray;font-size:30px" />
+
style="color:gray;font-size:30px" />
            </center>
+
</center>
            <east size="30%" flex="true" border="0">
+
<east title="East" size="30%" collapsible="true">
                <div style="background:#B8D335">
+
<div style="background:#B8D335"  vflex="1">
                    <label value="30%"
+
<label value="30%"
                        style="color:white;font-size:50px" />
+
style="color:white;font-size:50px" />
                </div>
+
</div>
            </east>
+
</east>
        </borderlayout>
+
</borderlayout>
    </center>
+
</center>
</borderlayout>
+
</borderlayout>
 
</source>
 
</source>
  
 +
=Properties and Features=
 +
== Caption ==
 +
A layout region might have a caption, which is specified by declaring a child component called caption.
 +
{{ZK EE}}
 +
{{versionSince| 6.5.0}}
  
 +
<source lang="xml" >
 +
<borderlayout>
 +
<center>
 +
<caption label="search" image="/img/live.gif">
 +
<combobox>
 +
<comboitem label="item 1" />
 +
<comboitem label="item 2" />
 +
<comboitem label="item 3" />
 +
<comboitem label="item 4" />
 +
</combobox>
 +
</caption>
 +
<div>
 +
Content
 +
</div>
 +
</center>
 +
</borderlayout>
 +
</source>
  
=Supported events=
+
=How to Layout=
 +
For more details, please refer to [[ZK_Component_Reference/Layouts/Borderlayout#How_to_Layout|Borderlayout]].
  
 +
=Supported Events=
  
{| border="1"
+
 
 +
{| class='wikitable' | width="100%"
 
! <center>Name</center>
 
! <center>Name</center>
! <center>Inherited From</center>
+
! <center>Event Type</center>
 
 
 
|-
 
|-
| <center><tt>OnOpen</tt></center>
+
| None
| <javadoc>org.zkoss.zk.ui.event.OpenEvent</javadoc>
+
| None
 
 
 
 
<tt>'''Description: '''When a layout is collapsed or opened by a user, the onOpen event is sent to the application.</tt>
 
 
 
 
|}
 
|}
 +
*Inherited Supported Events: [[ZK_Component_Reference/Base_Components/LayoutRegion#Supported_Events | LayoutRegion]]
  
 
=Supported Children=
 
=Supported Children=
Line 83: Line 104:
 
  *ALL
 
  *ALL
  
=Use cases=
+
=Use Cases=
  
[[ZK_Component_Reference/Layouts/Borderlayout|Borderlayout]]
+
[[ZK_Component_Reference/Layouts/Borderlayout#Use_Cases|Borderlayout]]
  
 
=Version History=
 
=Version History=
 
+
{{LastUpdated}}
{| border='1px' | width="100%"
+
{| class='wikitable' | width="100%"
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-
| 5.0.2
+
| 6.5.0
| 5/5/2010
+
| June 2012
| Initialization
+
| [http://tracker.zkoss.org/browse/ZK-969 ZK-969]: The LayoutRegion component support caption component as it's title
 
|}
 
|}
  
 
{{ZKComponentReferencePageFooter}}
 
{{ZKComponentReferencePageFooter}}

Latest revision as of 13:11, 7 January 2022

Center

Employment/Purpose

A center region of a border layout and only allows one component as its child.

Example

ZKCompRef Borderlayout.jpg

<borderlayout height="450px">
	<north title="North" maxsize="300" size="50%" splittable="true" collapsible="true">
		<borderlayout>
			<west title="West" size="25%" flex="true" maxsize="250" splittable="true" collapsible="true">
				<div style="background:#B8D335">
					<label value="25%"
						style="color:white;font-size:50px" />
				</div>
			</west>
			<center border="none">
				<div style="background:#E6D92C" vflex="1">
					<label value="25%"
						style="color:white;font-size:50px" />
				</div>
			</center>
			<east size="50%" border="none">
				<label value="Here is a non-border"
					style="color:gray;font-size:30px" />
			</east>
		</borderlayout>
	</north>
	<center border="0">
		<borderlayout>
			<west maxsize="600" size="30%" border="0" splittable="true">
				<div style="background:#E6D92C" vflex="1">
					<label value="30%"
						style="color:white;font-size:50px" />
				</div>
			</west>
			<center>
				<label value="Here is a border"
					style="color:gray;font-size:30px" />
			</center>
			<east title="East" size="30%" collapsible="true">
				<div style="background:#B8D335"  vflex="1">
					<label value="30%"
						style="color:white;font-size:50px" />
				</div>
			</east>
		</borderlayout>
	</center>
</borderlayout>

Properties and Features

Caption

A layout region might have a caption, which is specified by declaring a child component called caption.

  • Available for ZK:
  • http://www.zkoss.org/product/zkhttp://www.zkoss.org/whyzk/zkeeVersion ee.png

Since 6.5.0

<borderlayout>
	<center>
		<caption label="search" image="/img/live.gif">
			<combobox>
				<comboitem label="item 1" />
				<comboitem label="item 2" />
				<comboitem label="item 3" />
				<comboitem label="item 4" />
			</combobox>
		</caption>
		<div>
		Content
		</div>	
	</center>
</borderlayout>

How to Layout

For more details, please refer to Borderlayout.

Supported Events

Name
Event Type
None None

Supported Children

*ALL

Use Cases

Borderlayout

Version History

Last Update : 2022/01/07


Version Date Content
6.5.0 June 2012 ZK-969: The LayoutRegion component support caption component as it's title



Last Update : 2022/01/07

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