I've got a JSF datatable with an "add one" button below it. When pressed I add a new table row with input fields and a "save" button. This is all done by cloning an invisible template element and appending it to the table in JavaScript. The problem is that that new cloned form has no connection to JSF.
How can I make the row/table a JSF form that interacts with a backing bean? The cloning and appending can happen multiple times so copying a server-side generated JSF form (with unique IDs) won't work. Also I don't want to create the form in Java.