Other Events

Event Name

Components

Description

onCreate

all

Event: org.zkoss.ui.zk.ui.event.CreateEvent

Denotes a component is created when rendering a ZUML page. Refer to the Component Lifecycle chapter.

onClose

windowtabfileupload

Event: org.zkoss.ui.zk.ui.event.Event

Denotes the close button is pressed by a user, and the component shall detach itself.

onDrop

all

Event: org.zkoss.ui.zk.ui.event.DropEvent

Denotes another component is dropped to the component that receives this event. Refer to the Drag and Drop section.

onCheck

checkboxradio radiogroup

Event: org.zkoss.zk.ui.event.CheckEvent

Denotes the state of a component has been changed by the user.

Note: onCheck is sent to both radio and radiogroup.

onMove

window

Event: org.zkoss.zk.ui.event.MoveEvent

Denotes a component has been moved by the user.

onSize

window

Event: org.zkoss.zk.ui.event.SizeEvent

Denotes a component has been resized by the user.

onZIndex

window

Event: org.zkoss.zk.ui.event.ZIndexEvent

Denotes the z-index of a component has been changed by the user.

onTimer

timer

Event: org.zkoss.zk.ui.event.Event

Denotes the timer you specified has triggered an event. To know which timer, invoke the getTarget method in the Event class.

onNotify

any

Event: org.zkoss.zk.ui.event.Event

Denotes a application-dependent event. Its meaning depends on applications. Currently, no component will send this event.

onClientInfo

root

Event: org.zkoss.zk.ui.event.ClientInfoEvent

Notifies a root component about the client's information, such as time zone and resolutions.

onPiggyback

root

Event: org.zkoss.zk.ui.event.Event

Notifies a root component that the client has sent a request to the server. It is usually used to piggyback non-emergent UI updates to the client.

onBookmarkChanged

root

Event: org.zkoss.zk.ui.event.BookmarkEvent

Notifies that the user pressed BACK, FORWARD or others that causes the bookmark changed.

onColSize

columns listhead treecols

Event: org.zkoss.zul.event.ColSizeEvent

Notifies the parent of a group of headers that the widths of two of its children are changed by the user.

onPaging

gridlistboxpaging

Event: org.zkoss.zul.event.PagingEvent

Notifies one of the pages of a multi-page component is selected by the user.

onUpload

fileupload

Event: org.zkoss.zul.event.UploadEvent

Notifies that file(s) is uploaded, and the application can retrieve the uploaded files(s) by use of the getMedia or getMedias methods.

The Event Flow of radio and radiogroup

For developer's convenience, the onCheck event is sent to raido first and then to radiogroup[50]. Thus, you could add listener either to the radio group or to each radio button.

<radiogroup onCheck="fruit.value = self.selectedItem.label">
    <radio label="Apple"/>    
    <radio label="Orange"/>    
</radiogroup>
You have selected : <label id="fruit"/>

The above sample has the same effect as follows.

<radiogroup>
    <radio label="Apple" onCheck="fruit.value = self.label"/>    
    <radio label="Orange" onCheck="fruit.value = self.label"/>    
</radiogroup>
You have selected : <label id="fruit"/>


[50] The internal implementation is done by adding a listener when a radio is added to a radiogroup.