I'm working with JSF 2.2 with Primefaces 4.0 and I need to create a questionnaire with a dynamic amount of questions. This questions are radio type questions with 4 options each and I'm wondering the best (or easiest) way to do this.
As far my research goes one way of doing this is using DynaForm from Primefaces extensions (The current way I'm trying to do it). Another possible way of doing this is by creating a List<Question>
where
Public class Question{
//Something like this
private String question;
private List<String> options;
and calling it in a similar way as BalusC does it in his answer on dynamic adding radio and InputText in jsf. However, in my opinion, Datatable does not seems like a good solution for a SelectOneRadio type of input (Question plus all 4 options) As it does for inputText like on his original answer.
So which one is the best (easiest/simpler) way of doing this, and if it's like BalusC how should the valueChangeListener of the selectOneRadio be implemented so the String question and the selected answer of that question can be obtained for each question in the questionnaire, following (or Redefining if necessary) the provided Question class.