wood burning stoves 2.0
The moose likes JSF and the fly likes Inputfield in ui:repeat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Inputfield in ui:repeat" Watch "Inputfield in ui:repeat" New topic

Inputfield in ui:repeat

Dominik Müller
Ranch Hand

Joined: Apr 28, 2009
Posts: 36
Hi All,

have a problem here and i am running out of ideads to fix it.

I have a fomular with a dynamic amount of fields (based on a list from the managedbean) and i whould have editing fields for all values.
In general all works: for every element in the list i get an input element in the formular. But on submit NO VALUE will be transfered to the data objects, althought the browser post-command contains all values.
I break down my project to a very little example:

Simple ManagedBean


Somebody andy idea to solve the problem?

thanks a lot

PS: the alternative c:forEach fix the issue in that way that the changed values will be posted to the bean, but isn't an option because of the jsf behaviour of c:forEach (changing the underlying list (or add an elemend for example) will not change the amount of shown elements)
Srinivasan thoyyeti
Ranch Hand

Joined: Feb 15, 2007
Posts: 557

Root casue: I think the mapping of input text fields and backing bean is not set.

input text value:
<h:inputText value="#{element}" />

#{element} means #{StringReference}... now with this how JSF can figure out which backing bean and which property it has to set.

solution: I am not into JSF but
you can try something like

Iteration i from 0 to list size
<h:inputText value =#{RepeatHandler.stringList(i)}/>
end Iteration

Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
I agree. Here's the link: http://aspose.com/file-tools
subject: Inputfield in ui:repeat
It's not a secret anymore!