Over a million developers have joined DZone.

Metawidget: Display Screens, Facelets, and Improved Pluggability

DZone's Guide to

Metawidget: Display Screens, Facelets, and Improved Pluggability

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

Metawidget, the library that lets you generate a user interface from your domain objects, has come out with a new release. In an interview here on JavaLobby some months ago, Richard Kennard, Metawidget's creator, outlined the basic aims of the project and walked us through an example. In summary, Metawidget takes your existing back-end domain objects and creates, at runtime, UI components native to your existing front-end framework, as illustrated below:

Although it is a minor release, and again pre-1.0, (in fact, v0.43), a number of significant enhancements have now been made available. The release focuses specifically on the following feature enhancements:

  • Read-only mode for displaying business objects.

    Metawidgets can now toggle a setReadOnly mode, so now Metawidget can not only automatically generate the UI for data entry screens but also data display screens too. This potentially doubles the number of places in an application where a chunk of boilerplate code can be replaced with a Metawidget call.

    Metawidget: now twice as useful!

  • Facelets support.

    The Java Server Faces (JSF) Metawidget now supports the popular Facelets framework. Coupled with the existing JBoss RichFaces support, this makes it easy to retrofit existing JBoss Seam applications to remove boilerplate code.

    Using Metawidget with Seam, Facelets, JPA and Hibernate Validator

  • Mixin to ease development of custom Metawidgets.

    Whilst all Metawidgets necessarily extend the base classes of their target framework (such as JComponent for Swing and UIComponent for JSF), the new MetawidgetMixin gives a boost to those looking to develop custom Metawidgets. It provides pre-built functionality such as deciding when to use single versus compound widgets, support for overriding widgets, incorporating stubs, and changing between read-only and active modes.

    Implementing Your Own Metawidget and Plugging into Metawidget.


When learning about Metawidget, the best place to start is the Reference Documentation (PDF).

Your feedback is invaluable to the Metawidget team, use the Forums on the Metawidget site for this purpose.

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}