I want to pass a list of strings as hidden input from a jsf page to the backing bean.
The backing bean is request scoped and needs to be it.
Trying to do it this way, but it doesn’t seem to work. Any ideas how this can be done in a better way?
<ui:repeat value="#{bean.strings}" var="#{string}">
<h:inputHidden value="#{string}"/>
</ui:repeat>
Just use a converter for the list value:
Here is a converter that converts to/from a String using @@@ as separator:
If you are using JSF 2, this should work for you already as it is.
In case you are using JSF 1.2, you just have to drop the
@FacesConverterannotation and register the converter in thefaces-config.xmllike so: