Package javax.faces.component

Examples of javax.faces.component.NamingContainer


     * <p>This method must not return null.</p>
     */
    public String getClientId(FacesContext context, UIComponent component) {

  String clientId = null;
  NamingContainer closestContainer = null;
  UIComponent containerComponent = component;

        // Search for an ancestor that is a naming container
        while (null != (containerComponent =
                        containerComponent.getParent())) {
            if (containerComponent instanceof NamingContainer) {
                closestContainer = (NamingContainer) containerComponent;
                break;
            }
        }

        // If none is found, see if this is a naming container
        if (null == closestContainer && component instanceof NamingContainer) {
            closestContainer = (NamingContainer) component;
        }

        if (null != closestContainer) {

            // If there is no componentId, generate one and store it
            if (component.getComponentId() == null) {
                // Don't call setComponentId() because it checks for
                // uniqueness.  No need.
                clientId = closestContainer.generateClientId();
            } else {
                clientId = component.getComponentId();
            }

            // build the client side id
View Full Code Here

TOP

Related Classes of javax.faces.component.NamingContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.