You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2009/05/27 10:25:39 UTC

svn commit: r779049 - /myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java

Author: skitching
Date: Wed May 27 08:25:38 2009
New Revision: 779049

URL: http://svn.apache.org/viewvc?rev=779049&view=rev
Log:
Bugfix: the od:dynaConfig tag was incorrectly setting the MetaField.canWrite property; canWrite must be the *opposite* of readonly.
Also set canRead correctly.

Modified:
    myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java

Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java?rev=779049&r1=779048&r2=779049&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java Wed May 27 08:25:38 2009
@@ -32,7 +32,7 @@
  * <p>
  * The DynaForm uses a pluggable Extractor to analyse a particular class and determine what
  * persistent properties it has, and how to render them. By default the dynaform will
- * create a JSF component for each one of the detected persitent properties, using the
+ * create a JSF component for each one of the detected persistent properties, using the
  * detected metadata. 
  * <p>
  * Any number of instances of this component can be added as children to a DynaForm component
@@ -223,10 +223,14 @@
         {
             field.setDisplayOnly(getDisplayOnly());
         }
-        if (getReadOnly() != null)
-        {
-            field.setCanWrite(getReadOnly().booleanValue());
-        }
+
+        // field is writable unless readonly is true.
+        Boolean readOnly = getReadOnly();
+        field.setCanWrite(!Boolean.TRUE.equals(readOnly));
+
+        // fields are always readable
+        field.setCanRead(true);
+
         if (getDisabled() != null)
         {
             field.setDisabled(getDisabled().booleanValue());