diff options
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy')
5 files changed, 20 insertions, 6 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOAssociation.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOAssociation.java index 89623a6..86cfb0c 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOAssociation.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOAssociation.java @@ -88,8 +88,11 @@ public class WOAssociation implements java.io.Serializable { return null; if (value != null) return value; - if (path != null) + if (path != null) { + //System.err.printf("Querying for path '%s' in component '%s'\n", path, aComponent); return aComponent.valueForKey(path); + } + throw new RuntimeException("WOAssociation: neither value nor path specified!"); } @@ -99,6 +102,7 @@ public class WOAssociation implements java.io.Serializable { */ public void setValue(Object aValue, WOComponent aComponent) { if (path != null) { + //System.err.printf("Setting value '%s' for key '%s' in component '%s'\n", aValue, path, aComponent); aComponent.takeValueForKey(aValue, path); return; } diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java index 69b1118..8e8082d 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java @@ -469,8 +469,10 @@ public class WOComponent extends WOElement implements WOActionResults, net.woton public Object valueForBinding(String aBinding) { WOComponent parent = parent(); if (associations != null) { + //System.err.printf("Querying for association '%s' in component '%s'", aBinding, this); WOAssociation assoc = (WOAssociation) associations.objectForKey(aBinding); if (assoc != null && parent != null) { + //System.err.printf("Reading association '%s' for binding '%s' from component '%s'\n", assoc, aBinding, this); return assoc.valueInComponent(parent); } } diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WODynamicElement.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WODynamicElement.java index 62ea6ae..4aab168 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WODynamicElement.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WODynamicElement.java @@ -131,8 +131,10 @@ public abstract class WODynamicElement extends WOElement { /** Convenience method for setting the value of an association. */ void setValueForProperty(String key, Object value, WOComponent c) { WOAssociation a = (WOAssociation) associations.objectForKey(key); - if (a != null && a.isValueSettable()) + //System.err.printf("Attempting to set value '%s' for key '%s' in component %s (assoc. '%s')\n\tAssociations: %s\n", value, key, c, a, associations); + if (a != null && a.isValueSettable()) { a.setValue(value, c); + } } /** diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WORepetition.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WORepetition.java index 607ab97..7d3e47f 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WORepetition.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WORepetition.java @@ -31,7 +31,7 @@ public class WORepetition extends WODynamicElement { protected Object item; protected Collection list; protected Iterator iterator; - + protected WORepetition() { super(); } @@ -171,8 +171,8 @@ public class WORepetition extends WODynamicElement { } protected void pushValuesToParent(WOComponent c) { - setValueForProperty("index", new Integer(index), c); + setValueForProperty("index", Integer.valueOf(index), c); setValueForProperty("item", item, c); - } - + //System.err.printf("Loop index %d, item '%s' named item in component '%s'\n", index, item, c); + } } diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOString.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOString.java index 0c471d7..a3977db 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOString.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOString.java @@ -66,8 +66,12 @@ public class WOString extends WODynamicElement { escapeHTML = true; } + @Override public void appendToResponse(WOResponse aResponse, WOContext aContext) { WOComponent c = aContext.component(); + + //System.err.println("WOString value bound to " + (WOAssociation) associations.objectForKey("value")); + numberformat = stringForProperty("numberformat", c); dateformat = stringForProperty("dateformat", c); formatter = (Format) valueForProperty("formatter", c); @@ -102,6 +106,8 @@ public class WOString extends WODynamicElement { result = "nil"; } } + + //System.err.printf("WOString pre-value '%s' post-value '%s'\n", value, result); if (escapeHTML) { aResponse.appendContentHTMLString(result.toString()); } else { |
