Use isVisible()
method to find out which components needs to be cleared. Iterate through all the children and based on there visibility clear the values.
You can use instanceof Hidden
to find out hidden components only while iterating all the children.
Read more about List all the widgets of a page/panel in GWT