myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject cvs commit: incubator-myfaces/webapps/examples/web countryForm.jsp
Date Wed, 26 Jan 2005 13:55:16 GMT
mmarinschek    2005/01/26 05:55:16

  Modified:    src/jsfapi/javax/faces/component _ComponentUtils.java
               webapps/examples/web countryForm.jsp
  Log:
  restricted the matching ids in findComponent (is still not a perfect, but a quite good hack
now). Validation messages are shown in their extended form on countryForm.jsp as well.
  
  Revision  Changes    Path
  1.6       +8 -3      incubator-myfaces/src/jsfapi/javax/faces/component/_ComponentUtils.java
  
  Index: _ComponentUtils.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/jsfapi/javax/faces/component/_ComponentUtils.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- _ComponentUtils.java	26 Jan 2005 13:27:16 -0000	1.5
  +++ _ComponentUtils.java	26 Jan 2005 13:55:15 -0000	1.6
  @@ -105,7 +105,7 @@
   
               if(uiData.getRowIndex()==-1)
               {
  -                return id.startsWith(cmp.getId());
  +                return dynamicIdIsEqual(id,cmp.getId());
               }
               else
               {
  @@ -116,6 +116,11 @@
           return false;
       }
   
  +    private static boolean dynamicIdIsEqual(String dynamicId, String id)
  +    {
  +        return dynamicId.matches(id+"_[0-9]*");
  +    }
  +
   
       static void callValidators(FacesContext context, UIInput input, Object convertedValue)
       {
  
  
  
  1.27      +2 -2      incubator-myfaces/webapps/examples/web/countryForm.jsp
  
  Index: countryForm.jsp
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/web/countryForm.jsp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- countryForm.jsp	1 Nov 2004 23:04:26 -0000	1.26
  +++ countryForm.jsp	26 Jan 2005 13:55:16 -0000	1.27
  @@ -67,7 +67,7 @@
                           <h:outputLabel for="name" value="#{example_messages['label_country_name']}"/>
                           <h:panelGroup>
                               <h:inputText id="name" value="#{countryForm.name}" required="true"
/>
  -                            <h:message for="name" styleClass="error" showDetail="true"
showSummary="false" />
  +                            <x:message for="name" styleClass="error" showDetail="true"
showSummary="false" />
                           </h:panelGroup>
   
                           <h:outputLabel for="isoCode" value="#{example_messages['label_country_iso']}"/>
  @@ -75,7 +75,7 @@
                               <h:inputText id="isoCode" value="#{countryForm.isoCode}"
required="true">
                                   <f:validateLength maximum="2" minimum="2"/>
                               </h:inputText>
  -                            <h:message for="isoCode" styleClass="error" showDetail="true"
showSummary="false" />
  +                            <x:message for="isoCode" styleClass="error" showDetail="true"
showSummary="false" />
                           </h:panelGroup>
   
                           <h:panelGroup/>
  
  
  

Mime
View raw message