i have a CRUD generated create form:
You can't send data from many forms in a single request using JSF components, you should serialize all the data and send it manually. It would be better to have a List and every time you click in the button it will create a new item on the list and update an UIContainer that will display the items of the list.
This would be a start example of the above:
@ManagedBean
@ViewScoped
public class ItemBean {
private List- lstItem;
public ItemBean() {
lstItem = new ArrayList
- ();
addItem();
}
//getters and setter...
public void addItem() {
lstItem.add(new Item());
}
public void saveData() {
//you can inject the service as an EJB or however you think would be better...
ItemService itemService = new ItemService();
itemService.save(lstItem);
}
}
JSF code ( content only):
Enter item name
Enter item description