I'm new to JSF (using it for my master thesis) and I'm trying to achive the following:
I want to dynamically add and delete a row from a table and to refresh only that part and not the entire page
My case:
- I have two h:forms in a page, the first one displays data from an object passed through views
- In the second h:form I have a p:dataTable and a input form to add data in the table. The add button is using an f:ajax event to render the second h:form after adding the input. Everything till now works...
The problem is, that everytime I want to add a new entry in the table the old ones are deleted, or I cannot add an entry to the table. The responsible bean for the page is a request scope bean and everytime I execute a render oder update for the page, a new bean is created...
How can I add a row (or delete one) without creating every time a new bean? I just want to keep the added data.
If needed I can provide the code for this stange behavior...
Thanks in advance