I have referred to this blog post of Ilya to create dynamic closable tabs. Some differences between my implementation and the post :
1) switchType is client
2) I'm using richfaces 4
3) i'm using the activeItem to set the current tab as the newly created tab.
When I create say three tabs viz. a, b and c and try to close the b tab, the b tab's content vanishes as expected, but the id b is given to c. So in the DOM, I'm left with two tabs a and b (with contents of c) while i expect it to have a and c since i removed b.