myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svieu...@apache.org
Subject cvs commit: incubator-myfaces/src/share/org/apache/myfaces/renderkit/html HtmlRendererUtils.java
Date Sun, 23 Jan 2005 22:06:33 GMT
svieujot    2005/01/23 14:06:33

  Modified:    src/jsfapi/javax/faces/component UISelectMany.java
               src/share/org/apache/myfaces/renderkit/html
                        HtmlRendererUtils.java
  Log:
  Bugfix :  When no value were submitted, default values were set.
  This caused a bug when the component wasn't displayed (for example if it was in a TabPanel's
Tab that wasn't displayed).
  It was reseting the backend bean's value, and sometime causing Null Pointer Exceptions.
  
  Revision  Changes    Path
  1.15      +7 -3      incubator-myfaces/src/jsfapi/javax/faces/component/UISelectMany.java
  
  Index: UISelectMany.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/jsfapi/javax/faces/component/UISelectMany.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- UISelectMany.java	22 Jan 2005 16:47:17 -0000	1.14
  +++ UISelectMany.java	23 Jan 2005 22:06:33 -0000	1.15
  @@ -30,6 +30,11 @@
    * @author Manfred Geiler (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.15  2005/01/23 22:06:33  svieujot
  + * Bugfix :  When no value were submitted, default values were set.
  + * This caused a bug when the component wasn't displayed (for example if it was in a TabPanel's
Tab that wasn't displayed).
  + * It was reseting the backend bean's value, and sometime causing Null Pointer Exceptions.
  + *
    * Revision 1.14  2005/01/22 16:47:17  mmarinschek
    * fixing bug with validation not called if the submitted value is empty; an empty string
is submitted instead if the component is enabled.
    *
  @@ -252,7 +257,8 @@
   
           if(submittedValue instanceof String && ((String) submittedValue).length()==0)
           {
  -            submittedValue = null;
  +            submittedValue = null; // TODO : This is a bug, if set to null, you'll get
the following error :
  +            // java.lang.NullPointerException at org.apache.myfaces.renderkit._SharedRendererUtils.getConvertedUISelectManyValue(_SharedRendererUtils.java:118)
           }
   
           Object convertedValue = getConvertedValue(context, submittedValue);
  
  
  
  1.25      +18 -6     incubator-myfaces/src/share/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java
  
  Index: HtmlRendererUtils.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/share/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- HtmlRendererUtils.java	22 Jan 2005 16:47:17 -0000	1.24
  +++ HtmlRendererUtils.java	23 Jan 2005 22:06:33 -0000	1.25
  @@ -139,7 +139,10 @@
               //if the component has not been disabled
               if(!isDisabledOrReadOnly(component))
               {
  -                ((EditableValueHolder) component).setSubmittedValue(RendererUtils.EMPTY_STRING);
  +                ((EditableValueHolder) component).setSubmittedValue( null );
  +                // Was .setSubmittedValue(RendererUtils.EMPTY_STRING) before.
  +                // This caused a bug when the component wasn't displayed
  +                // (for example if it was in a TabPanel's Tab that wasn't displayed).
               }
           }
       }
  @@ -177,7 +180,10 @@
               //if the component has not been disabled
               if(!isDisabledOrReadOnly(component))
               {
  -                ((EditableValueHolder) component).setSubmittedValue(Boolean.FALSE);
  +                ((EditableValueHolder) component).setSubmittedValue( null );
  +                // Was .setSubmittedValue(Boolean.FALSE) before.
  +                // This caused a bug when the component wasn't displayed
  +                // (for example if it was in a TabPanel's Tab that wasn't displayed).
               }
           }
       }
  @@ -220,7 +226,10 @@
               //if the component has not been disabled
               if(!isDisabledOrReadOnly(component))
               {
  -                ((EditableValueHolder) component).setSubmittedValue(RendererUtils.EMPTY_STRING);
  +                ((EditableValueHolder) component).setSubmittedValue( null );
  +                // Was .setSubmittedValue(RendererUtils.EMPTY_STRING) before.
  +                // This caused a bug when the component wasn't displayed
  +                // (for example if it was in a TabPanel's Tab that wasn't displayed).
               }
           }
       }
  @@ -251,7 +260,10 @@
   
               if(!isDisabledOrReadOnly(component))
               {
  -                ((EditableValueHolder) component).setSubmittedValue(RendererUtils.EMPTY_STRING);
  +                ((EditableValueHolder) component).setSubmittedValue( null );
  +                // Was .setSubmittedValue(RendererUtils.EMPTY_STRING) before.
  +                // This caused a bug when the component wasn't displayed
  +                // (for example if it was in a TabPanel's Tab that wasn't displayed).
               }
           }
       }
  
  
  

Mime
View raw message