Attaching a bean with Form

I have a bean which has one inner bean. I would like to bind the parent bean
to a form. In the form, I need to display parent bean properties as well as
inner bean properties.
How it can be done?

Maybe
this post
might help you.

Also the
CustomField
component might be of use, although it is lacking examples (e.g. how to use it to implement nested forms).

I have used the CustomField add-on now I am able to display the fields in the inner bean as a sub form.
But commit or discard operations are not happening with the sub form.

I am not finding the solution for it.