I need to create an input form that will allow a user to enter any number of values for a particular attribute.
I've tried several approaches, all of which seem to have various levels of failure. The latest model bean looks something like:
public class Product {
private String name;
private ArrayList<String> tags = new ArrayList(5);
{
tags.add(""); //seed with 1 non-null element
}
...accessors...
}
The input fields look something like:
<h:dataTable id="tags" value="#{product.tags}" var="tag">
<h:column><h:inputText id="t" value="#{tag}"></h:inputText></h:column>
My plan was to allow the user is to use javascript to add additional form fields as needed.
This type of setup gives me a 'Target Unreachable' error. What am I missing?
My problem now is that the setter for tags does not get called. Oddly enough, the setter for name does.
I am using JSF 1.1 on WebSphere 6.1