Played some more and I create a literal Js Object, or some called Option Js object, like this:
-- private JavaScriptObject createOptions(final String name, final String value) {
return addOptions(JavaScriptObject.createObject(), name, value);
}
private native JavaScriptObject addOptions(final JavaScriptObject obj, final String name, final String value) /*-{
obj[name] = value;
return obj;
}-*/;
So use it like:
options = createOptions("opacity", "0.5");
Or
options = JavaScriptObject.createObject();
addOptions("opacity", "0.5");
addOptions("width", "100");
Works well... what do you think?
I will probably create a Factory/Facade that offers both options: through Json String data, or directly through JavascriptObject.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment