Update of /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/edit
In directory james.mmbase.org:/tmp/cvs-serv13649

Modified Files:
        SetFieldTag.java 
Log Message:
Removed some hackery, which made it impoosibel to set enuemration by constant 
value. MMB-1711


See also: 
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/edit
See also: http://www.mmbase.org/jira/browse/MMB-1711


Index: SetFieldTag.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/edit/SetFieldTag.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- SetFieldTag.java    14 Aug 2008 13:42:18 -0000      1.37
+++ SetFieldTag.java    19 Aug 2008 14:12:53 -0000      1.38
@@ -23,7 +23,7 @@
  *
  * @author Michiel Meeuwissen
  * @author Jaco de Groot
- * @version $Id: SetFieldTag.java,v 1.37 2008/08/14 13:42:18 michiel Exp $
+ * @version $Id: SetFieldTag.java,v 1.38 2008/08/19 14:12:53 michiel Exp $
  */
 
 public class SetFieldTag extends FieldTag { // but it is not a writer
@@ -83,21 +83,7 @@
                 node.setByteValue(fieldName, 
base64.transformBack(Casting.toString(value)));
             }
         } else {
-            String newValue = convert(Casting.toString(value));
-            // a bit of hackery to make it more likely that actually a right 
type is fed to the core.
-            // E.g. if you use ExprCalc to set an integer field, that would 
not work otherwise (because always double like '1.0')
-            switch(type) {
-            case Field.TYPE_NODE:
-            case Field.TYPE_INTEGER:
-                value = Casting.toInteger(newValue);
-                break;
-            case Field.TYPE_LONG:
-                value = Casting.toInteger(newValue);
-                break;
-            default: // rest should go ok in core
-                value = newValue;
-            }
-
+            value = convert(Casting.toString(value));
 
             if (log.isDebugEnabled()) {
                 log.debug("Setting field " + fieldName + " to " + value);
@@ -109,6 +95,7 @@
                 getContextProvider().getContextContainer().register(getId(), 
value);
             }
         }
+        body = null;
 
         return EVAL_PAGE;
     }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to