Update a dataset without reloading index

Hello all!

Again a special question about a flow only application.
Following scenario:

I have a “overview page” (feeded by indexAction of a custom model).
This overview ist structured like a TreeView. Branches of this TreeView
contain depending instances of other models and so on. Branch depth is variable from one to abaout five.

User can expand several sub-branches by clicking according icons.

Now my problem: if one edit on a sub-model instance, this is done in an modal. Form data there are filled by an AJAX call to a controller action.

Problem first part: how to process data, if an error occours on saving?
Without any special handling, flash messages and formdata are shown now unformatted in DOM root. How can I redirect the output to the modal?

Problem second part: if there are no erros on saving, index is reloaded into inital state. All “opened” sub-branches are closed. For the user very annoying…

I’ve tried to use $this->forward('index') in controllers updateAction. but this does not work.

Have someone some ideas or hints to solve theese problems.

The view is a TemplateView; can I use a JsonView here?

Flow Version is 8.3