The trouble with this approach is you are just creating the HTML, but the Mendix application doesn’t know about it, or how to target it.
If you are only creating a known number of tabs, then you may be able to do something with conditional visibility. You could pre-create all the tab containers, and you then hide them if there is no data to show.
I suggest to fetch the data to a datagrid and create a dataview with datasource as Listen to Widget, and inside that dataview you can show all the object related data.
This way you can achieve dynamic population of data for each object, kind of like vertical Tabs.