I need to build a form dynamically putting inputText field, I'm using this code:
<h:form>
<c:forEach items="#{userBean.getFieldList()}" var="field">
<h:inputText value="#{userBean.getFieldValue(field.name)}" />
</c:forEach>
<h:commandButton value="Login" action="#{userBean.loginAction}" />
</h:form>
the var field is a metadata and not own the field value but only their attribute. So I use
#{userBean.getFieldValue(field.name)}
to get the bean field value. The code above works well if it's used only to view the page. but not on form submit because of it's not possible to setFieldvalue by field name. Is there a way to override the problem? Is there a generale way to dynamically build a back bean edit form?