[jboss-user] [JBoss Seam] - inputText form array / dynamic form

damianharvey do-not-reply at jboss.com
Fri Apr 20 07:54:57 EDT 2007


Hi,

I have a form based inside a rich:datatable. The number of fields is dynamic and is backed by an ArrayList in the Bean. I understood that I can use an Array, Set or Map and refer to it in the page by:
<h:inputText id="firstname" value="#{myBean.name[0].firstname}"/>
  | <h:inputText id="firstname" value="#{myBean.name[1].firstname}"/>
  | etc.
This works fine for the output of the value that was set in the Bean however it doesn't work in reverse - ie. if I change this value, the change is not reflected in the bean. 

I've tried to find an example of this, but none exists (maybe that's a hint that it won't work?)

Is this possible or am I grasping? Should I just retrieve the input values in the Bean using the getParameters()? 

If the latter, how have people got around the fact that the parameter map doesn't have an array of 'firstname', but instead has something like 'myform:mydatatable:0:firstname' and myform:mydatatable:1:firstname'?

Thanks,

Damian.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039240#4039240

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039240



More information about the jboss-user mailing list