Reputation: 12347
we are migrating our application from an existing custom web application framework to JSF/IceFaces.
we store window description in database: what kind of fields are on the window, what are their labels, etc.
Can I have my xhtml pieces generated dynamically in IceFaces?
Upvotes: 1
Views: 526
Reputation: 2017
I was in the same situation and solved this by creating a custom JSF component
that extended class javax.faces.component.UIInput
. My custom
component reads the layout from the database and generates the
HTML itself in the encodeBegin()
and encodeEnd()
methods.
The custom component is integrated as a custom tag into the XHTML page.
The following web pages describe creating custom JSF components:
http://www.theserverside.com/news/1364786/Building-Custom-JSF-UI-Components
http://download.oracle.com/javaee/5/tutorial/doc/bnavg.html
Upvotes: 0
Reputation: 2635
metawidget might be a useful project in this case. It helps you to bind variable and render the ui. Please check out the metawidget project www.metawidget.org
Upvotes: 0
Reputation: 39907
Its not a good idea to handle these things using database. Its good to use xml/template-engines, instead.
Suggestion: Looking into Freemarker should help.
Upvotes: 1