Interface NamingContainer

All Known Implementing Classes:
UIData, UIForm, UINamingContainer

public interface NamingContainer

Interface implemented by components that provide a new "namespace" for the ids of their child components.

Component ids must be unique between all descendants of a NamingContainer; the JSF library will report a fatal error and refuse to process or render any view where two components in the same NamingContainer have identical id values. However a component that is a descendant of one NamingContainer component is permitted to have the same id as a component that is a descendant of a different NamingContainer component.

Unique component ids are used to:

Requiring every component in a large view (which is possibly built by including or composing multiple files together) to have an id which is different from every other id is simply unmanageable; JSF certainly must provide some kind of id namespacing. Therefore this base class is defined, and a few standard JSF components subclass it (in particular, f:subview).

When generating clientId values during rendering, descendants of a NamingContainer instance are allocated a clientId which is their own id prefixed with the clientId of the ancestor NamingContainer, eg "parentId:childId". NamingContainer components can be nested within other NamingContainer components, generating clientIds like "firstId:middleId:leafId".

Not every component is a naming container; that would technically work, but the clientId values generated would quickly grow excessively long.

See the javadoc for this class in the JSF Specification for further details.

$Revision: 1187700 $ $Date: 2011-10-22 12:19:37 +0000 (Sat, 22 Oct 2011) $
Manfred Geiler (latest modification by $Author: bommel $)

Field Summary
static char SEPARATOR_CHAR
          Deprecated. Use {@link UINamingContainer#getSeparatorChar(javax.faces.context.FacesContext)

Field Detail


static final char SEPARATOR_CHAR
Deprecated. Use {@link UINamingContainer#getSeparatorChar(javax.faces.context.FacesContext)
See Also:
Constant Field Values

Copyright © 2015 The Apache Software Foundation. All Rights Reserved.