diff options
author | Manuel Carrasco Moñino <manuel.carrasco.m@gmail.com> | 2014-01-07 08:26:21 +0100 |
---|---|---|
committer | Manuel Carrasco Moñino <manuel.carrasco.m@gmail.com> | 2014-01-07 08:26:21 +0100 |
commit | c4e2abb513ed173d7bd6fe240b65af2646dc2fd7 (patch) | |
tree | f47cf6c3402115c2266bb8ca656a3e89472226d8 | |
parent | 8b2d5f3d35c5550a78100616d7ef34294a44f70a (diff) | |
download | gwtquery-c4e2abb513ed173d7bd6fe240b65af2646dc2fd7.tar.gz gwtquery-c4e2abb513ed173d7bd6fe240b65af2646dc2fd7.zip |
Fix setters with Binder objects
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java | 7 | ||||
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java index c4b5af88..40dbdae7 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/builders/JsonBuilderBase.java @@ -17,6 +17,7 @@ package com.google.gwt.query.client.builders; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.JsArray; +import com.google.gwt.query.client.Binder; import com.google.gwt.query.client.Properties; import com.google.gwt.query.client.js.JsObjectArray; import com.google.gwt.query.client.js.JsUtils; @@ -123,7 +124,11 @@ public abstract class JsonBuilderBase<J extends JsonBuilderBase<?>> implements J @SuppressWarnings("unchecked") public <T> T set(Object key, Object val) { - p.set(key, val); + if (val instanceof Binder) { + p.set(key, ((Binder)val).getBound()); + } else { + p.set(key, val); + } return (T)this; } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java index 38f32b0e..5de9dc31 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java @@ -256,7 +256,7 @@ public class JsonBuilderGenerator extends Generator { } else if (type.isEnum() != null){ sw.println("p.set(\"" + name + "\", a.name());"); }else { - sw.println("p.set(\"" + name + "\", a);"); + sw.println("set(\"" + name + "\", a);"); } if (!"void".equals(retType)) { if (isTypeAssignableTo(method.getReturnType(), |