简体   繁体   中英

Best data binding solution for GWT

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 eg 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

In case of any doubt about this nowadays, you should use GWT Editors:

http://www.gwtproject.org/doc/latest/DevGuideUiEditors.html

At some point in the future there will be support for jsr 303 validation too.

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).

if its data binding of the UI to models (ie 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 )

I suggest you try HexaBinding, which is non invasive and only focused on dara binding. Here is the link : https://github.com/ltearno/hexa.tools/blob/master/hexa.binding/README.md

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).

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/

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM