-
Metawidget 0.5, runtime form generator, released (7 messages)
- Posted by: Richard Kennard
- Posted on: June 16 2008 23:20 EDT
Metawidget 0.5 has been released. Metawidget is an Open Source 'smart UI widget' that populates itself at runtime with labels, textboxes, date pickers, etc. to match the underlying properties of a given business object. The project comes with native versions for Android, Java Server Faces, JSP, Spring, Struts, Swing and (as of this release) Google Web Toolkit. Out of the box, it can discover properties from JavaBeans, Hibernate configuration files, Hibernate Validator annotations, JPA annotations and (as of this release) GroovyBeans. Metawidget doesn't try to 'own' the entire User Interface, it creates widgets for embedding into your existing UI - giving you the best of both worlds between automatic UI generation whilst still retaining flexibility over look and feel, choice of third-party components etc. The new GWT version continues Metawidget's tradition of using reflection and inspecting existing business object annotations (such as JPA, Hibernate Validator etc). This is despite the fact that JavaScript supports neither reflection nor annotations! It also provides pluggable layouts and automatic two-way data binding, which are cumbersome to code by hand in GWT. The new Groovy support allows Metawidget to inspect GroovyBean properties, and in particular the annotations defined on GroovyBean properties, to help make accurate widget choices. For example, if your GroovyBean property uses a Hibernate Validator annotation @Max, Metawidget will limit the upper bound of the spinner or slider widget it creates. Additional blog entries can be found on http://kennardconsulting.blogspot.com Metawidget can be downloaded from http://www.metawidget.orgThreaded Messages (7)
- Re: Metawidget 0.5, runtime form generator, released by Miguel Ping on June 18 2008 07:04 EDT
- Fine grained form generation by Richard Kennard on June 18 2008 07:22 EDT
- Re: Metawidget 0.5, runtime form generator, released by Pierre Queinnec on June 18 2008 07:30 EDT
- Binding/validation frameworks by Richard Kennard on June 18 2008 07:49 EDT
- dynamic properties of object by Romen Law on June 19 2008 03:16 EDT
- Re: dynamic properties of object by Richard Kennard on June 19 2008 06:32 EDT
- Re: dynamic properties of object by Richard Kennard on June 19 2008 06:33 EDT
- Re: dynamic properties of object by Richard Kennard on June 19 2008 06:32 EDT
-
Re: Metawidget 0.5, runtime form generator, released[ Go to top ]
- Posted by: Miguel Ping
- Posted on: June 18 2008 07:04 EDT
- in response to Richard Kennard
Looks like a good addition specially to GWT, for me. GWT needs binding/validation frameworks. I'll have to go check the docs to see if you have fine grained control on the form generation (like rendering some fields in some screens only, etc). -
Fine grained form generation[ Go to top ]
- Posted by: Richard Kennard
- Posted on: June 18 2008 07:22 EDT
- in response to Miguel Ping
Hi Miguel. Yes, Metawidget offers several options for fine grained control over your form generation. On a per screen basis (like you asked) you can 'stub out' fields using stub widgets (for GWT, org.metawidget.gwt.client.ui.Stub). You can also use pluggable layouts (org.metawidget.gwt.client.ui.layout.FlexTableLayout, org.metawidget.gwt.client.ui.layout.FlowLayout etc) and facet widgets (org.metawidget.gwt.client.ui.Facet). On a per field basis, you can use a wealth of annotations and/or subclass GwtMetawidget at designated 'hook methods' (eg. GwtMetawidget.buildActiveWidget). Please see the included Reference Guide, and in particular addressbook-gwt.war, for a concrete example of all of the above. Look forward to hearing how you go, Richard. -
Re: Metawidget 0.5, runtime form generator, released[ Go to top ]
- Posted by: Pierre Queinnec
- Posted on: June 18 2008 07:30 EDT
- in response to Miguel Ping
GWT needs binding/validation frameworks
There are some GWT databinding frameworks out there. IIRC there was a port of JFace databinding to GWT [1], there's ZenBinding (shameless plug) [2], and I recall I saw some other ones out there on GoogleCode. [1] http://wiki.eclipse.org/Eclipse_Techs_For_GWT/Databinding [2] http://code.google.com/p/zenbinding/ -
Binding/validation frameworks[ Go to top ]
- Posted by: Richard Kennard
- Posted on: June 18 2008 07:49 EDT
- in response to Pierre Queinnec
Hi Pierre. To clarify, Metawidget is not trying to be a data binding framework. It provides a simple bidirectional binding implementation (org.metawidget.gwt.client.binding.simple.SimpleBinding), but this is pluggable because I'd like to plug in 'proper' binding support (either an 'official' implementation in a future version of GWT, or ZenBinding, etc). It'd be great if you could look at whether you could write an implementation of org.metawidget.gwt.client.binding.Binding that uses ZenBinding. Regards, Richard. -
dynamic properties of object[ Go to top ]
- Posted by: Romen Law
- Posted on: June 19 2008 03:16 EDT
- in response to Richard Kennard
Interesting. Does it cover the scenario where my object contains a list of properties (name-value pairs) stored in a collection? cheers romen -
Re: dynamic properties of object[ Go to top ]
- Posted by: Richard Kennard
- Posted on: June 19 2008 06:32 EDT
- in response to Romen Law
Romen. Thanks for the great question. I have written a blog entry for you with some working code: http://kennardconsulting.blogspot.com/2008/06/metawidget- and-namevalue-pairs.html But the short answer is yes: Metawidget can read properties from almost any source. It can even combine properties from multiple sources using its 'CompositeInspector'. -
Re: dynamic properties of object[ Go to top ]
- Posted by: Richard Kennard
- Posted on: June 19 2008 06:33 EDT
- in response to Richard Kennard
Sorry that link got mangled. It's meant to point here.