I cannot create dynamic instances in xojo web of the TabPanel1 object

I am trying the WebTabPanel object on the web platform from the ide you can create the various tabs, but I would like to understand how to make new tabs via code. so that you can dare to let users create their own tabs, how can I do this?

I checked in the Documentation, there is a method whose name is AddControl, but it does no t seem to be able to add a Tab to a TabPanel.

Under the Notes, there is

Adding, labelling, and renaming tabs

In the Inspector, click the value of the Panels property of the TabPanel to display the Tab Panel editor. From this dialog box, you can:

  • Rename the existing tab labels by clicking twice on its name and editing the name.
  • Add tabs and their labels by clicking the Add button.
  • Delete any tab by highlighting it and clicking Delete.
  • Rearrange the tabs by highlighting a tab and clicking the Up or Down buttons.

You add controls to a particular panel by clicking its tab and dragging controls to that panel.

So it seems that it would not be possible to add a Tab programmatically.

through ide I can create without problems the problem that should be done even via code which now does not agree to do.

That is not currently possible. You’ll need to find a different design. Perhaps you should use Containers and swap them out in code instead of using a TabPanel.

and yes, but if an object gives you the ability to create tabs, it should also be integrated via code.

But it’s not. You cannot create new tabs in code. That’s just the reality of the situation.

Instead of using a TabPanel, use a set of WebContainers, which you can add dynamically, and hide when you don’t need them. Use buttons to replace the tabs.

1 Like

WebContainer is the only way to go.

2 Likes

Just in case third-party is on the table, GraffitiTabPanel allows adding tabs at runtime and a whole lot more.

4 Likes

There is an open Feature Request for this, if you want to give it a thumb up:
#63119 - Would like ability to add / remove pages at runtime to WebTabPanel

4 Likes