Hi,

I had a similar requirement for a form here.
I had an List of object to visually edit. The objects were carrying
their description, value and type. I created, for each type, a wrapper
bean that provided a method UIComponent createEditor(some environment
stuff); I then created a custom component (let's name
<custom:genericEditor value="<wrapped object to edit>"),  that has
responsability to
1) setup, for it's children, an accessible request scoped variable that
refered to objet to edit
2) create a tomahawk subform (some very complex editors needed to do
partial submit)
3) act as NamingContainer
4) dynamically populate the subform's children list upon first need
using the createEditor()

En l'instant précis du 03/07/07 10:48, Michael Heinen s'exprimait en ces
termes:
>
> Hi,
>
>  
>
> 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) ???
>
>  
>
> Michael
>

Reply via email to