Hi Colin,

We have forms which we dynamically render based on an underlying (xml) set
of questions and response types. We use a simple table to render the form
and provide a set of form elements (lists, radio buttons, spinners, text
entry) each with an appropriate validator and message and then render only
one of the form elements based on the needs of the particular question. As
no validation or input is performed on a non-rendered component it works
very well and provides a robust and flexible way of creating forms on the
fly. One detail we needed to manage was returning the value of an arbitary
form element after the form is submitted. We achieved this by creating an
updatable list of objects and then convert the resulting object to an
expected value type. This is actually easy as we set up converters on each
control which gurantees the return type unless a valiation error is thrown.


-----Original Message-----
From: Colin Chalmers [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 15, 2006 2:39 PM
To: MyFaces Discussion
Subject: parsing xml to build UI

Hi all,

I have an interesting problem whereby I'm receiving xml from an external
party which defines error messages and validation rules as well as input
types.
I'm looking into mapping this to UIcomponents via a sax parser but am kind
of against building my screen in code and want to do the layout in the
template.

The number of input elemants is dynamic and may change. I was looking into
phase listeners to aid me in doing this but would like to check if anyone
else has built something similiar or worked regularly integrating components
in code with template layouts.???

Colin

Reply via email to