I need to refresh the p:tabView after doing an action (to display error messages etc.).
The fields to validate are on various tabs. When I update the whole tabView, this is of course buggy behaviour, because in PrimeFaces the invisible tabs should not be updated (because the edit fields are invisible, and when they are refreshed, they are loosing their values, for example p:autoComplete is nulled).
So, I should update the active tab only, but how to target with update attribute of commandButton only the active tab, not the whole p:tabView?
Best Answer
I made a short example:However, when I update the
p:tab
by ID or by using@parent
(like I do in tab 1) the tab (div) gets deleted, strange... A workaround is to wrap the content of the tab in a container like I did in tab 2.HA! Found the reason why you cannot update a tab directly: https://code.google.com/p/primefaces/issues/detail?id=3518
Example with the button outside the tabview: