Other Events"

From Documentation
m (Created page with '{{ZKDevelopersGuidePageHeader}} __TOC__ {| border="1" ! <center>Event Name</center> ! <center>Components</center> ! <center>Description</center> |- | onCreate | all | Event: …')
 
(3 intermediate revisions by 2 users not shown)
Line 11: Line 11:
 
|  onCreate
 
|  onCreate
 
| all
 
| all
| Event: <tt>org.zkoss.ui.zk.ui.event.CreateEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.CreateEvent</javadoc>
  
 
Denotes a component is created when rendering a ZUML page. Refer to the '''Component Lifecycle''' chapter.
 
Denotes a component is created when rendering a ZUML page. Refer to the '''Component Lifecycle''' chapter.
Line 20: Line 20:
 
tab
 
tab
 
fileupload
 
fileupload
| Event: <tt>org.zkoss.ui.zk.ui.event.Event</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.Event</javadoc>
  
 
Denotes the close button is pressed by a user, and the component shall detach itself.
 
Denotes the close button is pressed by a user, and the component shall detach itself.
Line 27: Line 27:
 
|  onDrop
 
|  onDrop
 
| all
 
| all
| Event: <tt>org.zkoss.ui.zk.ui.event.DropEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.DropEvent</javadoc>
  
 
Denotes another component is dropped to the component that receives this event. Refer to the ''Drag and Drop'' section.
 
Denotes another component is dropped to the component that receives this event. Refer to the ''Drag and Drop'' section.
Line 35: Line 35:
 
|  checkbox
 
|  checkbox
 
radio radiogroup
 
radio radiogroup
| Event: <tt>org.zkoss.zk.ui.event.CheckEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.CheckEvent</javadoc>
  
 
Denotes the state of a component has been changed by the user.
 
Denotes the state of a component has been changed by the user.
Line 44: Line 44:
 
|  onMove
 
|  onMove
 
|  window
 
|  window
| Event: <tt>org.zkoss.zk.ui.event.MoveEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.MoveEvent</javadoc>
  
 
Denotes a component has been moved by the user.
 
Denotes a component has been moved by the user.
Line 51: Line 51:
 
|  onSize
 
|  onSize
 
|  window
 
|  window
| Event: <tt>org.zkoss.zk.ui.event.SizeEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.SizeEvent</javadoc>
  
 
Denotes a component has been resized by the user.
 
Denotes a component has been resized by the user.
Line 58: Line 58:
 
|  onZIndex
 
|  onZIndex
 
|  window
 
|  window
| Event: <tt>org.zkoss.zk.ui.event.ZIndexEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.ZIndexEvent</javadoc>
  
 
Denotes the z-index of a component has been changed by the user.
 
Denotes the z-index of a component has been changed by the user.
Line 65: Line 65:
 
|  onTimer
 
|  onTimer
 
|  timer
 
|  timer
| Event: <tt>org.zkoss.zk.ui.event.Event</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.Event</javadoc>
  
 
Denotes the timer you specified has triggered an event. To know which timer, invoke the <tt>getTarget</tt> method in the <tt>Event</tt> class.
 
Denotes the timer you specified has triggered an event. To know which timer, invoke the <tt>getTarget</tt> method in the <tt>Event</tt> class.
Line 72: Line 72:
 
|  onNotify
 
|  onNotify
 
| ''any''
 
| ''any''
| Event: <tt>org.zkoss.zk.ui.event.Event</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.Event</javadoc>
  
 
Denotes a application-dependent event. Its meaning depends on applications. Currently, no component will send this event.
 
Denotes a application-dependent event. Its meaning depends on applications. Currently, no component will send this event.
Line 79: Line 79:
 
|  onClientInfo
 
|  onClientInfo
 
| ''root''
 
| ''root''
| Event: <tt>org.zkoss.zk.ui.event.ClientInfoEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.ClientInfoEvent</javadoc>
  
 
Notifies a root component about the client's information, such as time zone and resolutions.
 
Notifies a root component about the client's information, such as time zone and resolutions.
Line 86: Line 86:
 
|  onPiggyback
 
|  onPiggyback
 
| ''root''
 
| ''root''
| Event: <tt>org.zkoss.zk.ui.event.Event</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.Event</javadoc>
  
 
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.
 
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.
Line 93: Line 93:
 
|  onBookmarkChange
 
|  onBookmarkChange
 
| ''root''
 
| ''root''
| Event: <tt>org.zkoss.zk.ui.event.BookmarkEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.BookmarkEvent</javadoc>
  
 
Notifies that the user pressed BACK, FORWARD or others that causes the bookmark changed.
 
Notifies that the user pressed BACK, FORWARD or others that causes the bookmark changed.
Line 100: Line 100:
 
|  onColSize
 
|  onColSize
 
|  columns listhead treecols
 
|  columns listhead treecols
| Event: <tt>org.zkoss.zul.event.ColSizeEvent</tt>
+
| Event: <javadoc>org.zkoss.zul.event.ColSizeEvent</javadoc>
  
 
Notifies the parent of a group of headers that the widths of its children are changed by the user.
 
Notifies the parent of a group of headers that the widths of its children are changed by the user.
Line 109: Line 109:
 
listbox
 
listbox
 
paging
 
paging
| Event: <tt>org.zkoss.zul.event.PagingEvent</tt>
+
| Event: <javadoc>org.zkoss.zul.event.PagingEvent</javadoc>
  
 
Notifies one of the pages of a multi-page component is selected by the user.
 
Notifies one of the pages of a multi-page component is selected by the user.
Line 116: Line 116:
 
|  onUpload
 
|  onUpload
 
|  fileupload
 
|  fileupload
| Event: <tt>org.zkoss.zul.event.UploadEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.UploadEvent</javadoc>
  
 
Notifies that file(s) is uploaded, and the application can retrieve the uploaded files(s) by use of the <tt>getMedia</tt> or <tt>getMedias</tt> methods.
 
Notifies that file(s) is uploaded, and the application can retrieve the uploaded files(s) by use of the <tt>getMedia</tt> or <tt>getMedias</tt> methods.
Line 123: Line 123:
 
|  onFulfill
 
|  onFulfill
 
| ''all''
 
| ''all''
| Event: <tt>org.zkoss.zul.event.FulfillEvent</tt>
+
| Event: <javadoc>org.zkoss.zk.ui.event.FulfillEvent</javadoc>
  
 
Notifies that the fulfill condition has been applied to the target component. It is posted after all descendant components have been created.
 
Notifies that the fulfill condition has been applied to the target component. It is posted after all descendant components have been created.
Line 150: Line 150:
 
</source>
 
</source>
  
For more information, please refer to this [http://docs.zkoss.org/wiki/Prompt_the_User_before_Doing_a_Long_Operation_with_Echo_Event small talk].
+
For more information, please refer to this [http://books.zkoss.org/wiki/Small_Talks/2007/December/Prompt_the_User_before_Doing_a_Long_Operation_with_Echo_Event small talk].
  
 
=== The Event Flow of radio and radiogroup ===
 
=== The Event Flow of radio and radiogroup ===

Revision as of 02:49, 17 December 2010

Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


Event Name
Components
Description
onCreate all Event: CreateEvent

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

onClose window

tab fileupload

Event: Event

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

onDrop all Event: DropEvent

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

onCheck checkbox

radio radiogroup

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: MoveEvent

Denotes a component has been moved by the user.

onSize window Event: SizeEvent

Denotes a component has been resized by the user.

onZIndex window Event: ZIndexEvent

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

onTimer timer 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: Event

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

onClientInfo root Event: ClientInfoEvent

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

onPiggyback root 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.

onBookmarkChange root Event: BookmarkEvent

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

onColSize columns listhead treecols Event: ColSizeEvent

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

onPaging grid

listbox paging

Event: PagingEvent

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

onUpload fileupload 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.

onFulfill all Event: FulfillEvent

Notifies that the fulfill condition has been applied to the target component. It is posted after all descendant components have been created.

Echo Event

Echo event allows you to provide more richer message before doing long operation.

<window id="w" width="200px" title="Test echoEvent" border="normal">
  <attribute name="onLater">
  Thread.sleep(5000);
  Clients.showBusy(null, false);
  new Label("Done.").setParent(w);
  </attribute>

  <button label="Echo Event">
  <attribute name="onClick">
  Clients.showBusy("Execute... (about 5 sec.)", true);
  Events.echoEvent("onLater", w, null);
  </attribute>
  </button>
</window>

For more information, please refer to this small talk.

The Event Flow of radio and radiogroup

For developer's convenience, the onCheck event is sent to raido first and then to radiogroup[1]. 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"/>


  1. The internal implementation is done by adding a listener when a radio is added to a radiogroup.



Last Update : 2010/12/17

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