File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inputfield in ui:repeat

 
Dominik Müller
Ranch Hand
Posts: 36
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


JSF


Somebody andy idea to solve the problem?

thanks a lot
Dominik

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
Posts: 557
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Muler,

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

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic