Most used api for Implicit Objects and Static Classes
From Documentation
This documentation is for an older version of ZK. For the latest one, please click here.
Overview
Besides setAttribute
, getAttribute
. We will list some useful api of implicit object and Static Classes like Executions
and Path
. For more information, please refer to their javadoc. They are all under package org.zkoss.zk.ui.
self
setVisible
: Sets whether this component is visible.setParent
: Sets the parent component.removeChild
: Removes a child.
Because self
will be cast to evaluating component, therefore its api is not limited to org.zkoss.zk.ui.Component
.
For example
<tab label="OnDemand" onSelect="load(self.linkedPanel)"/>
linkedPanel
is mapping to getLinkedPanel
of Tab.java
spaceOwner
In most case, it will be cast to window
.
page
desktop
enableServerPush
: to enable server pushsetBookmark
: Sets a bookmark to this desktop.getBookmark
: Returns the current bookmark (never null).
execution
getArg
: Returns the parameters (aka., arg) ifpushArg
is called recently.getParameter
: Returns the value of a request parameter as a String. a example
session
setAttribute
: Sets the value of the specified custom attribute.getAttribute
: Returns the value of the specified custom attributegetNativeSession
: Returns the native session.getRemoteAddr
: Returns the Internet Protocol (IP) address of the client or last proxy that sent the first request creating this session.getDeviceType
: Returns the device type that this session belongs to.
In most cases, we use session
to setAttribute
and getAttribute
.
application
getConfiguration
: Returns the configuration.getInitParameter
: Returns the value of the named context-wide initialization parameter.
event
org.zkoss.zk.ui.event.Event
or derived
stopPropagation
: Stops the propagation for this event.getTarget
: Returns the target component that receives this event.getName
: Returns the event name.getData
: Returns the data accompanies with this event.
event
may be casted to subclass like KeyEvent
, InputEvent
.
Executions
createComponents
: Creates components from a page file specified by an URI.
getCurrent
: Returns the current execution.
getCurrent().getParameter
: Returns the value of a request parameter as a String
forward
: A shortcut of Executions.getCurrent().forward(page).
sendRedirect
: Sends a temporary redirect response to the client using the specified redirect location URL.
wait
: Suspends the current processing of an event and wait notify for the specified object.
notify
: Wakes up a single event processing thread that is waiting on the specified object.
activate
: Activates a server-push thread.
deactivate
: Deactivates a server-push thread.
Path
getComponent
: Returns the component of the specified path
Clients
evalJavaScript
: Asks the browser to evaluate the specified JavaScript.scrollIntoView
: Scrolls the ancestor elements to make the specified element visible.showBusy
: Shows the busy message at the brower such that the user knows the system is busy.