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

Modified Files:
      Tag: MMBase-1_8
        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.34
retrieving revision 1.34.2.1
diff -u -b -r1.34 -r1.34.2.1
--- SetFieldTag.java    23 Nov 2005 10:29:39 -0000      1.34
+++ SetFieldTag.java    19 Aug 2008 14:12:18 -0000      1.34.2.1
@@ -23,7 +23,7 @@
  *
  * @author Michiel Meeuwissen
  * @author Jaco de Groot
- * @version $Id: SetFieldTag.java,v 1.34 2005/11/23 10:29:39 michiel Exp $ 
+ * @version $Id: SetFieldTag.java,v 1.34.2.1 2008/08/19 14:12:18 michiel Exp $
  */
 
 public class SetFieldTag extends FieldTag { // but it is not a writer
@@ -82,21 +82,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);
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to