|
Hello, I am attempting to develop a page that has
some rows formed by input components, which are generated on the run according
to the contents of a collection as follows:
<ui:repeat value="#{searchTreeBean.dataFieldList}"
var="dataField">
<tr>
<td align="right">#{dataField.description} </td>
<td>
<h:inputText id="#{dataField.userColumn}"
maxlength="#{dataField.entryLength}" size="#{dataField.entrySize}"/>
<f:verbatim>&nbsp;&nbsp;&nbsp;</f:verbatim>
</td>
<td>
<h:selectBooleanCheckbox
value="#{dataField.returnSelected}" />
</td>
<td>
<input type="radio"
name="orderby" checked="#{dataField.orderBySelected}"></input>
</td>
</tr>
</ui:repeat> I have achieved the first part which is printing out
the list of rows successfully but I have no idea on how to keep the state of
the values that the user inputs as they aren´t specifically mapped to setters
of a managed bean since they are completely dynamic. The managedBean
returns a Collection of elements of type dataField, which has getters for
description, userColumn, etc. How can I guarantee that when the user
sends a submit the state that he entered is kept and mapped to the bean
somehow? Another question that I have related to this problem
is the use of the selectOneRadio component? I wasn´t able to use it to
generate dynamic radiobuttons since the syntax is something like: <h:selectOneRadio id="radioList"
layout="pageDirection"> <f:selectItem itemValue="0"
itemLabel="cats"/> <f:selectItem
itemValue="1" itemLabel="dogs"/> <f:selectItem
value="#{animalForm.lizardGroup}"/> </h:selectOneRadio> And the options that I would have are each in a
different row and I have no idea where to place the container element:
selectOneRadio? Anyone has any ideas ? Regards, JV |

