When a commandLink is clicked, a new row should be added in the DataTable.
The data entered in the previous row is being cleared when the link is clicked.
I added <f:ajax event="click" render="@form" listener="bean.method"/> for <h:commandLink>.
What is the solution for this problem.
The bean is apparently request scoped and is apparently not saving the data of the previous row so that it can be preloaded in the bean’s constructor of the next request.
Putting the bean in a bit broader scope should fix this problem. I’d recommend putting the bean in the view scope. This way the bean will live as long as you’re returning
voidornullin action methods.See also: