You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/02/13 02:24:20 UTC

svn commit: r627214 - /myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java

Author: lu4242
Date: Tue Feb 12 17:24:19 2008
New Revision: 627214

URL: http://svn.apache.org/viewvc?rev=627214&view=rev
Log:
fix MYFACES-1811 cannot set enctype on h:form with el

Modified:
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java?rev=627214&r1=627213&r2=627214&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java Tue Feb 12 17:24:19 2008
@@ -74,8 +74,20 @@
 
     out.println();
     out.println("// Property: " + propName);
-    out.println("private " + propertyClass + propertyGenerics + " " +
-        fieldPropName + (def == null ? ";" : " = " + def + ";"));
+    if (property.isLiteralOnly() || property.isTagAttributeExcluded()){
+        //If the property is literal or is tagAttributeExcluded, 
+        //the default value goes on the definition of the field
+        out.println("private " + propertyClass + propertyGenerics + " " +
+                fieldPropName + (def == null ? ";" : " = " + def + ";"));        
+    }else{        
+        //If is a primitive class, has a set field to check if this
+        //property is defined, so the default value goes on the 
+        //getter method.
+        //If is a class, the same applies, because the check
+        //is against null
+        out.println("private " + propertyClass + propertyGenerics + " " +
+                fieldPropName + ";");        
+    }
 
     if (Util.isPrimitiveClass(propertyFullClass) && !property.isTagAttributeExcluded())
     {