HowTo: Set visible columns/headers BEFORE setting datasource?

I have: JPA objects -
parent
and
child
. Parent have Set with @Transient container, which dynamically filled from Set in get-method. I also have 2 tables - one for
parents
list, and another - for
children
of currently selected
parent
.
Question: How can I set visiblecolumns and columnheaders for
child
table, while there is no non-empty datasource attached to this table? For example - I have initially selected
parent
with no
children
… For now I just setting columnheaders and visiblecolumns in valuechangeevent of
parent
table (I make it once - use boolean flag of my own).