Other Events"
m (correct highlight (via JWB)) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 39: | Line 39: | ||
Denotes the state of a component has been changed by the user. | Denotes the state of a component has been changed by the user. | ||
− | Note: < | + | Note: <code>onCheck</code> is sent to both <code>radio</code> and <code>radiogroup</code>. |
|- | |- | ||
Line 67: | Line 67: | ||
| Event: <javadoc>org.zkoss.zk.ui.event.Event</javadoc> | | Event: <javadoc>org.zkoss.zk.ui.event.Event</javadoc> | ||
− | Denotes the timer you specified has triggered an event. To know which timer, invoke the < | + | Denotes the timer you specified has triggered an event. To know which timer, invoke the <code>getTarget</code> method in the <code>Event</code> class. |
|- | |- | ||
Line 116: | Line 116: | ||
| onUpload | | onUpload | ||
| fileupload | | fileupload | ||
− | | Event: <javadoc>org.zkoss. | + | | 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 < | + | Notifies that file(s) is uploaded, and the application can retrieve the uploaded files(s) by use of the <code>getMedia</code> or <code>getMedias</code> methods. |
|- | |- | ||
| onFulfill | | onFulfill | ||
| ''all'' | | ''all'' | ||
− | | Event: <javadoc>org.zkoss. | + | | 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 129: | Line 129: | ||
|} | |} | ||
− | ===< | + | ===<code>Echo</code> Event=== |
Echo event allows you to provide more richer message before doing long operation. | Echo event allows you to provide more richer message before doing long operation. | ||
Line 150: | Line 150: | ||
</source> | </source> | ||
− | For more information, please refer to this [http:// | + | 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 === | ||
− | For developer's convenience, the < | + | For developer's convenience, the <code>onCheck</code> event is sent to <code>raido</code> first and then to <code>radiogroup<ref>The internal implementation is done by adding a listener when a <code>radio</code> is added to a <code>radiogroup</code>.</ref>. Thus, you could add listener either to the radio group or to each radio button. |
<source lang="xml" > | <source lang="xml" > | ||
Line 162: | Line 162: | ||
</source> | </source> | ||
− | You have selected : < | + | You have selected : <code><label id="fruit"/></code> |
The above sample has the same effect as follows. | The above sample has the same effect as follows. | ||
Line 173: | Line 173: | ||
</source> | </source> | ||
− | You have selected : < | + | You have selected : <code><label id="fruit"/></code> |
Latest revision as of 10:45, 19 January 2022
This documentation is for an older version of ZK. For the latest one, please click here.
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: |
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 |
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 |
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"/>
- ↑ The internal implementation is done by adding a listener when a
radio
is added to a radiogroup
.