myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Heinen" <>
Subject how to render various components dynamically for a generic editor ?
Date Tue, 03 Jul 2007 08:48:45 GMT


I have to create a generic editor with various fields based on a
configuration(file, database ...). Each field can be rendered as a
different input type, e.g. selectOneCheckbox, selectManyCheckbox,
selectOneRadio, selectOneMenu, selectManyMenu or even inside a tree2
structure. Moreover I have to add validators and converters to the
components, e.g. for numeric input, dates etc.


I am currently no sure what's the best approach for this and I would be
happy about some feedback.

I am sure that some of you have to implement these type of requirements
and therefore I look forward to your recommendations and experiences.


I see the following alternatives:

a) loop over the fields in the jsp (with a datalist) and define all the
possible types of components.

   Then the rendered attribute could be used to show/hide them based on
the configuration.

   --> seems not very performant

   --> no idea how to add converters and validators because they don't
offer a rendered attribute


b) create the UIComponents and the component tree on serverside and use
component bindings

  --> complicates the maintenance from my point of view. because
styleclasses, js-eventhandlers etc must be set in java.


c) use some kind of dynamic includes ?

  --> ??


d) ???



View raw message