AfterSizeEvent"

From Documentation
m ((via JWB))
Line 31: Line 31:
 
=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 45: Line 45:
 
=Use cases=
 
=Use cases=
  
{| border='1px' | width="100%"
+
{| class='wikitable' | width="100%"
 
! Version !! Description !! Example Location
 
! Version !! Description !! Example Location
 
|-
 
|-
Line 55: Line 55:
 
=Version History=
 
=Version History=
  
{| border='1px' | width="100%"
+
{| class='wikitable' | width="100%"
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-

Revision as of 11:06, 7 January 2022


AfterSizeEvent

AfterSizeEvent

Employment/Purpose

Represents an event that resizes and provides the new size of a component.

Example

Resize the window component to show different sized images accordingly.

<window title="AfterSizeEvent" border="normal" width="250px" height="200px" maximizable="true" sizable="true">
	<custom-attributes org.zkoss.zul.image.preload="true" />
	<attribute name="onAfterSize"><![CDATA[
		int width = event.getWidth();
		if (width >= 600)
			image.setSrc("/image/large.jpg");
		else if (width >= 400 && width < 600)
			image.setSrc("/image/medium.jpg");
		else
			image.setSrc("/image/small.jpg");
	]]></attribute>
	<image id="image" src="/image/small.jpg" />
</window>

Supported events

Name
Event Type
None None

Supported Children

*NONE

Use cases

Version Description Example Location
     

Version History

Version Date Content
6.5.2 March 2013 Add onAfterSize event to get component size



Last Update : 2022/01/07

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