views:

6212

answers:

9

Have you ever used one of the many half-baked data binding solutions for GWT? If so, how well did it work?

I'd like to stop rolling my own bindings for GWT but there's no clear winner in the data binding space.

I'd prefer to use something with a future e.g. GWT Incubator but there's nothing there yet.

I use GWTDesigner and love it but it doesn't seem to have a solution for this either.

Its a pretty fundamental missing feature. Do you know if the GWT team plans to add support for this? In that case, maybe I'll wait.

Thanks

A: 

Hey,

i have just read it a few minutes ago in a mailing list that a so called GWTEventService 1.0 has been released. I am not completely sure, if that is what you want, but it sounds promising for me.

Let me cite the site:

GWTEventService is an event-based client-server communication framework. It uses GWT-RPC and the Comet / server-push technique. The client side offers a high-level API with opportunities to register listeners to the server like to a GUI component. Events can be added to a context/domain on the server side and the listeners on the client side get informed about the incoming events. The server side is completely independent of the client implementation and is highly configurable. Domains can be defined to decide which events are important for the different contexts.

Maybe this is a solution for you. I will give it a try.

Maerch
+1  A: 

SmartGWT ( http://www.jroller.com/sjivan/entry/smartgwt_1_0_released ) is a GWT API for the product smartclient. They have a good databinding solution, because it was built with server side integration in mind. But the downside is that it's not a pure native GWT framework. It's a JSNI wrapper around another product (Smart Client Framework).

Edwin
More info: data binding currently requires the pro license, $745 per developer.
dfrankow
A: 

Gilead, formerly Hibernate4GWT, "defines a PersistentRemoteService class, inheriting from RemoteServiceServlet to handle seamlessly persistent entity management." It's been under active development for several years now.

Glenn
This lets you pass a JDO-annotated object from the server to client, but still does nothing with building the UI from the object, nor validation, etc.
dfrankow
Well, the original question is not about building a UI or validation, etc., it's about data binding. A buddy who works with me wrote a container class for widgets that are derived from standard Widgets; these derived widgets reference property names and the container class handles database interaction via the property names. This seems to be the answer to a different question, though.
Glenn
+1  A: 

if its data binding of the UI to models (i.e. a textbox bound to a property of some model object), then GWT has a library feature called the UIBinder. Its not quite ready for production use yet apparently (thus unreleased), but the google wave team is using it (and looks like its working pretty good). Checkout this page for some info http://code.google.com/p/google-web-toolkit-incubator/wiki/UiBinder

If you are talking about GWT RPC returning model objects from the server (such as hibernate objects), Gilead as mentioned elsewhere is probably worth looking at - though i've never had any personal experience.

There is another method, and that is using Javascript Object Overlays to turn json into their equivalent class models for use in GWT (good for frameworks like grails that can churn out json easily, but their domain model is not RPC compatible). check out these blog posts for some tips on that http://raibledesigns.com/rd/entry/json_parsing_with_javascript_overlay (and http://googlewebtoolkit.blogspot.com/2008/08/getting-to-really-know-gwt-part-2.html )

Chii
As I understand it, UiBinder is about throwing together GWT UIs from a declarative (e.g. XML) format, not about data binding.
Geoffrey Wiseman
if you area talking about binding straight from the server, then no - its not like the existing binding frameworks out there - Gilead is prob something you'd be wanting. UIBinder binds to the UI variables that you can insert at runtime - this is immensely powerful, and can be the basis for a binding framework you allude to in the above comment.
Chii
A: 

check out the eclipse databinding 3.5 for gwt

Christoph
A: 

use google-web-toolkit-incubator http://code.google.com/p/google-web-toolkit-incubator/wiki/Downloads?tm=2 for databinding. uface doesnt have a compiled version out, and their source code DOESNT compile following their directions. (entry right above this one is referring to uface).

A: 

what's not compiling? Would you mind filing a bug telling us where you get a compile error?

Tom Schindl
This should be a comment for Samedude's answer, not an answer by itself.
Robert Munteanu
Tom Schindl
+3  A: 

You can check out http://code.google.com/p/gwt-pectin/

Andrew
A: 

Check out the gwtXP at http://www.gdevelop.com/w/gwtxp/.

gwtXP allows you to declare UI elements, data binding and action handlers in XML. Examples:

  • Declare UI elements: <g:label text="User Name: "/>
  • Declare data binding (uses Eclipse data binding): <g:textBox text="${user.userName}"/>
  • Support both value binding and list binding.
  • Declare action handlers: <g:button text="Save" onClick="#{saveUser}"/>

Updated on March 06 20010: See the post at http://www.gdevelop.com/w/blog/2010/03/06/data-binding-in-gwt/

Trung