Class ClientWindow

java.lang.Object
jakarta.faces.lifecycle.ClientWindow
Direct Known Subclasses:
ClientWindowImpl, ClientWindowWrapper

public abstract class ClientWindow extends Object

This class represents a client window, which may be a browser tab, browser window, browser pop-up, portlet, or anything else that can display a UIComponent hierarchy rooted at a UIViewRoot.

Modes of Operation

none mode

The generation of ClientWindow is controlled by the value of the context-param named by the value of CLIENT_WINDOW_MODE_PARAM_NAME. If this context-param is not specified, or its value is "none", no ClientWindow instances will be generated, and the entire feature is effectively disabled for the entire application.

Other modes

To accomadate the widest possible range of implementation choices to support this feature, explicit names for modes other than "none" and "url" are not specified. However, for all values of CLIENT_WINDOW_MODE_PARAM_NAME, the lifetime of a ClientWindow starts on the first request made by a particular client window (or tab, or pop-up, etc) to the Jakarta Faces runtime and persists as long as that window remains open or the session expires, whichever comes first. A client window is always associated with exactly one UIViewRoot instance at a time, but may display many different UIViewRoots during its lifetime.

The ClientWindow instance is associated with the incoming request during the Lifecycle.attachWindow(jakarta.faces.context.FacesContext) method. This method will cause a new instance of ClientWindow to be created, assigned an id, and passed to ExternalContext.setClientWindow(jakarta.faces.lifecycle.ClientWindow).

During state saving, regardless of the window id mode, or state saving mode, for ajax and non-ajax requests, a hidden field must be written whose name, id and value are given as specified in ResponseStateManager.CLIENT_WINDOW_PARAM.

In addition to the hidden field already described. The runtime must ensure that any component that renders a hyperlink that causes the user agent to send a GET request to the Faces server when it is clicked has a query parameter with a name and value specified in ResponseStateManager.CLIENT_WINDOW_URL_PARAM. This requirement is met by several of the "encode" methods on ExternalContext. See ExternalContext.encodeActionURL(java.lang.String) for details.

Since:
2.2