I need to generate a questionaire form per user based on the user's profile. My plan is like this: 1. create a base jsf page with a blank form with submit and cancel buttons. 2. create a jsp code snippet file per question type. 3. iterate through the user's profile, and include corresponding code snippet for each question.
If you use Facelets you can use xhtml pages as templates. create your template, and have one xhtml doc that is defining the content via an HTMLPanelGroup that it gets from a backing bean. So you can build up your UIComponents in code and pass it out to the page.
If each question is an Object then you can create an xhtml page that displays the parts of the Object and just return the object from the backing bean.
If you want all the questions to appear at once, then you could return a list of these objects to the page and use something like a datatable to loop through.
Originally posted by Ctrl Space Enter: I need to generate a questionaire form per user based on the user's profile. My plan is like this: 1. create a base jsf page with a blank form with submit and cancel buttons. 2. create a jsp code snippet file per question type. 3. iterate through the user's profile, and include corresponding code snippet for each question.
They use XML documents to define questionnaires and then use JAXB to create an object graph from said documents. The web interface is JSF based on completely dynamic based on the survey being used.