myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject cvs commit: incubator-myfaces/src/components/org/apache/myfaces/component/html/util HtmlComponentUtils.java
Date Fri, 14 Jan 2005 08:06:32 GMT
matzew      2005/01/14 00:06:32

  Modified:    webapps/examples/web forceId.jsp
               src/components/org/apache/myfaces/component/html/util
                        HtmlComponentUtils.java
  Log:
  added patch form Sean Schofield. forceId for reuse of "legacy JavaScript" (MyFaces-70)
  
  Revision  Changes    Path
  1.3       +3 -2      incubator-myfaces/webapps/examples/web/forceId.jsp
  
  Index: forceId.jsp
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/web/forceId.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- forceId.jsp	13 Jan 2005 09:24:53 -0000	1.2
  +++ forceId.jsp	14 Jan 2005 08:06:32 -0000	1.3
  @@ -64,11 +64,12 @@
   			   <h:panelGrid columns="3">
   
                       <h:outputText id="forceOneOutput" value="#{example_messages['forceOne']}"/>
  -                    <h:inputText id="forceOne" value="#{forceIdBean.valueOne}"/>
  +                    <h:inputText required="true" id="forceOne" value="#{forceIdBean.valueOne}"/>
                       <h:message id="forceOneMessage" for="forceOne" styleClass="error"
/>
   
                       <h:outputText id="forceTwoOutput" value="#{example_messages['forceTwo']}"/>
  -                    <x:inputText id="forceTwo" value="#{forceIdBean.valueTwo}" forceId="true"/>
  +                    <x:inputText required="true" id="forceTwo" value="#{forceIdBean.valueTwo}"
forceId="true"/>
  +                    <h:message id="forceTwoMessage" for="forceTwo" styleClass="error"
/>
   
   				<h:panelGroup/>
   			  	<h:commandButton id="button" value="#{example_messages['button_submit']}" action="go_home"/>
  
  
  
  1.3       +4 -33     incubator-myfaces/src/components/org/apache/myfaces/component/html/util/HtmlComponentUtils.java
  
  Index: HtmlComponentUtils.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/component/html/util/HtmlComponentUtils.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HtmlComponentUtils.java	13 Jan 2005 09:24:53 -0000	1.2
  +++ HtmlComponentUtils.java	14 Jan 2005 08:06:32 -0000	1.3
  @@ -15,13 +15,13 @@
    */
   package org.apache.myfaces.component.html.util;
   
  -import org.apache.myfaces.renderkit.JSFAttr;
  -import javax.faces.component.UIComponent;
   import javax.faces.component.NamingContainer;
  +import javax.faces.component.UIComponent;
   import javax.faces.component.UIData;
   import javax.faces.context.FacesContext;
   import javax.faces.render.Renderer;
  -import java.util.HashMap;
  +
  +import org.apache.myfaces.renderkit.JSFAttr;
   
   /**
    * <p>Utility class for providing basic functionality to the HTML faces 
  @@ -84,35 +84,6 @@
               if (renderer != null)
               {
                   clientId = renderer.convertClientId(context, clientId);
  -            }
  -            
  -            /**
  -             * Since components that use this utility are intended to be 
  -             * rendered in HTML they should conform to the XHTML standard 
  -             * which mandates that each component have a unique id.  
  -             * Right now this is pretty much impossible to enforce in the 
  -             * appropriate Renderer class so its being done here.
  -             */
  -            HashMap idMap = (HashMap)context.getViewRoot().getAttributes().get(KEY_COMPONENT_ID_MAP);
  -
  -            if (idMap == null)
  -            {
  -                idMap = new HashMap();
  -                context.getViewRoot().getAttributes().put(KEY_COMPONENT_ID_MAP, idMap);
  -            }
  -
  -            if (idMap.containsKey(clientId))
  -            {
  -                UIComponent mappedComponent = (UIComponent)idMap.get(clientId);
  -                if (component.equals(mappedComponent))
  -                {
  -                    throw new IllegalArgumentException(
  -                        "Duplicate cliientId not allowed.  View already contains the id:
" + clientId);
  -                }
  -            }
  -            else
  -            {
  -                idMap.put(clientId, component);
               }
               
               return clientId;
  
  
  

Mime
View raw message