Vaadin CustomLayout alternatives in Vaadin 23

I had an old project based on Vaadin 8 which used CustomLayout to dynamically generate and rendered UI based on the XML received from the server side along with the dynamically created widgets and injected into the Div by using its “id” element.

How can I replicate the same with Vaadin 23? Any Idea or sample example code will be beneficial to me and solve my problem as I have a Low Coding Platform based on that principle.

Check also flow-viritin/src/test/java/org/vaadin/firitin/ at v23 · viritin/flow-viritin · GitHub for some alternatives

@quintessential-ibex has been working on this recently, he’s doing a blog post about it as we speak

Yeah, just pushed the CustomLayout component in the file linked by Olli to in.virit:viritin:1.6.0. Maven central currently syncing it. My suggestion is to take that. Better performance than in the solution in the cookbook. The thing to note is that ids are really ids, so must be unique within the page. But as you are providing a dynamic template, it shouldn’t be an issue.

Looks similar to my enhanced custom layout where I reduced the overhead of jsoup by just manually parsing the first element / tag instead of the whole tree

Yeah, this doesn’t parse anything, just passes the raw html to the browser and innerHMTL property → fastest way to add html dynamically in browsers.