[jboss-user] [JBoss Seam] - generating forms programatically

steshaw do-not-reply at jboss.com
Mon Nov 26 11:56:09 EST 2007


Hi. I'm pretty new to Seam and JSF. I'm using it with Facelets and RichFaces/Ajax4j. I've been looking predominantly at the bookings demo as an example of how to get going. I noticed that in templates (I call all .xhtml Facelet files templates) defining forms there are a fair bit of boiler place with the instantiating of the "edit.xhtml" composition.

I'm wondering if you can programatically create a form. This way you can even build generic forms for domain objects in your app. This technique is used by users of the Click framework and also Tapestry. Tapestry 5 seems to have some specific support for it, calling it BeanEditForm.

Any hints about how to build a FormBuilder with Seam/JSF/Facelets/RichFaces or otherwise dealing with the boiler plate around form construction?

One of the features I am hoping to have with my FormBuilder is to notice when the form is read-only and use output fields instead of input boxes (i.e. build a "display page" rather than an "input form"). I'd also like to hide the boilerplate for adding decorators for required fields, validation and error messages. This way I can switch the entire app over from errors at the top to errors next to fields or decide globally whether to use ajax4j for validation onblur. This should help with maintenance problems as the project evolves.

Cheers,
Steve.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107799#4107799

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107799



More information about the jboss-user mailing list