Alex Rivera | Logout

How to dynamically add JSF components

Asked 2010-08-04T19:22:32.553
33

Can I add JSF components dynamically? I need to have a form with a button which should add one <h:inputText> to the form. Is this possible?

I know this should be possible in JavaScript somehow. Do anybody know how to do this in JSF? I think the major problem is how do I get or set values of new inputs via #{value}.

Edit
Report

1 Answer

0

Use h:dataTable to add elements dynamically... Have a list of any type you want to provide values for dataTable...

In h:dataTable... you can include the element tag to create inside <h:column>

It will be used to generate elements you want to create dynamically.

answered 2013-01-24T05:45:40.333

Your Answer