Most used api for Implicit Objects and Static Classes

From Documentation
Documentationost used api for Implicit Objects and Static Classes
ost used api for Implicit Objects and Static Classes


Stop.png 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

org.zkoss.zk.ui.Component

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

org.zkoss.zk.ui.IdSpace

In most case, it will be cast to window.

page

org.zkoss.zk.ui.Page

desktop

org.zkoss.zk.ui.Desktop

enableServerPush : to enable server push
setBookmark : Sets a bookmark to this desktop.
getBookmark : Returns the current bookmark (never null).

execution

org.zkoss.zk.ui.Execution

getArg : Returns the parameters (aka., arg) if pushArg is called recently.
getParameter : Returns the value of a request parameter as a String. a example

session

org.zkoss.zk.ui.Session

setAttribute : Sets the value of the specified custom attribute.
getAttribute : Returns the value of the specified custom attribute
getNativeSession : 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

org.zkoss.zk.ui.WebApp

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

org.zkoss.zk.ui.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

org.zkoss.zk.ui.Path

getComponent : Returns the component of the specified path

Clients

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.



Last Update : 2022/01/20

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