CustomField -- Nested Form display issue

I have a nested form display for my domain object OrgUnit which contains another domain object Address. I used the customfield addon to create my nested form and to a large extent it works fine. However there is a certain state in my application where I wish to show an empty space in the form pending selection events in other parts of the application.
However, when I do a parentForm.setItemDataSource(null), only the parentForm i.e the OrgUnit form display is blanked out, but the nestedForm which shows the address still shows up with the previous selection details. I tried to explicitly null out the AddressField object (a customField extension which handles the address display) but to no avail.

Is this a bug in the CustomField add-on? Or am I missing something?

Any ideas appreciated.

Thanks in advance

I assume your nested form is nested as a single block, you are not trying to move the fields of the subform to the layout of the parent form.

I suspect that this is related to how Form removes (or does not remove) fields it has created from its layout, and the problem is not necessarily specific to CustomField. The related logic is somewhat complicated.

To make it easier to debug this, could you provide a short example (Application class) that demonstrates the problem?