AfterSizeEvent"
From Documentation
m (Created page with "{{ZKComponentReferencePageHeader}} = AfterSizeEvent = *Demonstration: N/A *Java API: <javadoc>org.zkoss.zk.ui.event.AfterSizeEvent</javadoc> *JavaScript API: N/A = Employment/...") |
m (→Example) |
||
Line 14: | Line 14: | ||
Resize the window to show different size of image accordingly. | Resize the window to show different size of image accordingly. | ||
<source lang="xml" high="3"> | <source lang="xml" high="3"> | ||
− | <window title=" | + | <window title="AfterSizeEvent" border="normal" width="250px" height="200px" maximizable="true" sizable="true"> |
<custom-attributes org.zkoss.zul.image.preload="true" /> | <custom-attributes org.zkoss.zul.image.preload="true" /> | ||
<attribute name="onAfterSize"><![CDATA[ | <attribute name="onAfterSize"><![CDATA[ |
Revision as of 01:39, 15 March 2013
AfterSizeEvent
- Demonstration: N/A
- Java API: AfterSizeEvent
- JavaScript API: N/A
Employment/Purpose
Represents an event that resize a component and provides the new size of the component.
Example
Resize the window to show different size of image 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
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 |