OpenEvent

Represents an event cause by user's openning or closing something at the client.

Note: it is a bit confusing but Events.ON_CLOSE is sent when user clicks a close button. It is a request to ask the server to close a window, a tab or others. If the server ignores the event, nothing will happen at the client. By default, the component is detached when receiving this event.

On the other hand, Events.ON_OPEN (with OpenEvent) is a notification. It is sent to notify the server that the client has opened or closed something. And, the server can not prevent the client from opening or closing.

Class Name

org.zkoss.zk.ui.event.OpenEvent

Methods

Name

Description

Data Type

getReference

Returns the reference that is the component causing Event.getTarget() to be opened.

It is null, if the open event is not caused by opening a context menu, a tooltip or a popup. Note: the onOpen event is also sent when closing the context menu (tooltip and popup), and this method returns null in this case. Thus, it is better to test isOpen() or getReference() before accessing the returned value. if (event.isOpen()) doSome(event.getReference());

Component

isOpen

Returns whether it causes open..

boolean

Inherited From