|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.event.Event
org.zkoss.zk.ui.event.OpenEvent
public class 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.
Openable| Constructor Summary | |
|---|---|
OpenEvent(java.lang.String name,
Component target,
boolean open)
Constructs an onOpen event. |
|
OpenEvent(java.lang.String name,
Component target,
boolean open,
Component ref)
Constructs an onOpen event for a context menu, a tooltip or a popup. |
|
| Method Summary | |
|---|---|
Component |
getReference()
Returns the reference that is the component causing Event.getTarget()
to be opened. |
boolean |
isOpen()
Returns whether it causes open. |
| Methods inherited from class org.zkoss.zk.ui.event.Event |
|---|
getData, getName, getPage, getTarget, isPropagatable, stopPropagation, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OpenEvent(java.lang.String name,
Component target,
boolean open)
open - whether the new status is open
public OpenEvent(java.lang.String name,
Component target,
boolean open,
Component ref)
target - the component being openedref - the component that causes target to be opened.| Method Detail |
|---|
public Component getReference()
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());
public final boolean isOpen()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||