From: Manuel Carrasco MoƱino Date: Tue, 7 Jan 2014 07:26:21 +0000 (+0100) Subject: Fix setters with Binder objects X-Git-Tag: gwtquery-project-1.4.3~44^2~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c4e2abb513ed173d7bd6fe240b65af2646dc2fd7;p=gwtquery.git Fix setters with Binder objects --- 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> implements J @SuppressWarnings("unchecked") public 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(),