ClientInfoEvent"

From Documentation
m (correct highlight (via JWB))
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{ZKComponentReferencePageHeader}}
 
{{ZKComponentReferencePageHeader}}
  
= OrientationEvent =
+
= ClientInfoEvent =
  
 
*Demonstration: N/A
 
*Demonstration: N/A
*Java API: <javadoc>org.zkoss.zk.ui.event.OrientationEvent </javadoc>
+
*Java API: <javadoc>org.zkoss.zk.ui.event.ClientInfoEvent </javadoc>
 
*JavaScript API: N/A
 
*JavaScript API: N/A
  
 
= Employment/Purpose =
 
= Employment/Purpose =
  
Represents orientation change event on tablet when user changes the orientation.
+
The onClientInfo event is used to notify the client's information, such as orientation change, time zone and screen resolutions.
  
 
'''Note:''' All root components of all pages of the desktop will receives this event.
 
'''Note:''' All root components of all pages of the desktop will receives this event.
Line 16: Line 16:
 
To register this event can resize the layout to fit the whole screen for user.
 
To register this event can resize the layout to fit the whole screen for user.
  
<source lang="xml" high="2,3,4,5,6,7,8,9,10,11,12,13">
+
<source lang="xml" highlight="2,3,4,5,6,7,8,9,10,11,12,13">
 
<tabbox id="tbx" height="400px" width="600px">
 
<tabbox id="tbx" height="400px" width="600px">
<attribute name="onOrientationChange"><![CDATA[
+
<attribute name="onClientInfo"><![CDATA[
OrientationEvent oe = (OrientationEvent) event;
+
ClientInfoEvent oe = (ClientInfoEvent) event;
 
String orient = oe.getOrientation();
 
String orient = oe.getOrientation();
 
lbl.setValue(orient);
 
lbl.setValue(orient);
Line 44: Line 44:
 
=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 58: Line 58:
 
=Use cases=
 
=Use cases=
  
{| border='1px' | width="100%"
+
{| class='wikitable' | width="100%"
 
! Version !! Description !! Example Location
 
! Version !! Description !! Example Location
 
|-
 
|-
Line 68: Line 68:
 
=Version History=
 
=Version History=
  
{| border='1px' | width="100%"
+
{| class='wikitable' | width="100%"
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-

Latest revision as of 08:50, 19 January 2022

ClientInfoEvent

Employment/Purpose

The onClientInfo event is used to notify the client's information, such as orientation change, time zone and screen resolutions.

Note: All root components of all pages of the desktop will receives this event.

Example

To register this event can resize the layout to fit the whole screen for user.

<tabbox id="tbx" height="400px" width="600px">
		<attribute name="onClientInfo"><![CDATA[
			ClientInfoEvent oe = (ClientInfoEvent) event;
			String orient = oe.getOrientation();
			lbl.setValue(orient);
			if (orient.equals("portrait")) {
				tbx.setHeight("600px");
				tbx.setWidth("400px");
			} else {
				tbx.setHeight("400px");
				tbx.setWidth("600px");
			}
		]]></attribute>
		<tabs>
			<tab label="tab 1" />
		</tabs>
		<tabpanels>
			<tabpanel>
				Current Orientation: <label id="lbl"/>
			</tabpanel>
		</tabpanels>
	</tabbox>


Supported events

Name
Event Type
None None

Supported Children

*NONE

Use cases

Version Description Example Location
     

Version History

Version Date Content
6.5.0 July, 2012 Add a way to listen onOrientationChange for tablet device



Last Update : 2022/01/19

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