Of course, my use case will be more complex (dynamic views loaded by ajax call) so the goal is not to use something like a mutliview. I want to be able to click on a button, load a view, display it in a view. Click on an other button, then load a view, and replace the previous one. And so on… What’s wrong with my snippet?
In the original code you are replacing the “content” template on first call. So on time of second call there is no “content” template so target for new UI can’t be located.
In updated snippet code replaces the content of layout, but layout itself stays in place, and can be reused in future calls.