I have a formpanel which contains multiple nested panels. Those panels contain form fields and the panels may be copied/moved around with drag & drop.

Now if I copy one of the panels it also copies the form fields but they are not 'registered' with the main form and I need to find a way to do that. The fields must remain in their respective parent panel, so I can't just add() them to the formpanel. But if I don't the form doesn't know about them and they aren't submitted.

Any ideas?

I found out that forms have a _fields array that contains all the fields the form knows about, but simply appending to that array somehow doesn't seem like the right way