I have a page that has a form view of a list of entities.
There is an Add button, when clicked, it creates a new row added to the list and shows empty form fields so user can fill.
I try to use a Cancel button (immediate=true), when user change his mind and want to discard the new row just added, he can click Cancel button to remove it and the form shows next available entity.
My problem is when I remove the new row, the next existing entity doesn't get populated in the form. I guess this is because the "immediate=true" on Cancel button.
My question is how I can restore the form view with existing entity populated after removing new row?