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

**URL:** <https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215>\
**Category:** Web\
**Created:** [September 12, 2022, 8:25pm UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215 "2022-09-12T20:25:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefano\_Basile](https://forum.xojo.com/user_avatar/forum.xojo.com/stefano_basile/32/1487_2.png) [@Stefano\_Basile](https://forum.xojo.com/u/Stefano_Basile)\
**Post date:** [September 12, 2022, 8:25pm UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/1 "2022-09-12T20:25:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Gilles\_Plante](https://forum.xojo.com/user_avatar/forum.xojo.com/gilles_plante/32/667_2.png) [@Gilles\_Plante](https://forum.xojo.com/u/Gilles_Plante)\
**Post date:** [September 12, 2022, 9:40pm UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/2 "2022-09-12T21:40:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Stefano\_Basile](https://forum.xojo.com/user_avatar/forum.xojo.com/stefano_basile/32/1487_2.png) [@Stefano\_Basile](https://forum.xojo.com/u/Stefano_Basile)\
**Post date:** [September 13, 2022, 5:46am UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/3 "2022-09-13T05:46:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [September 13, 2022, 7:34am UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/4 "2022-09-13T07:34:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Stefano\_Basile](https://forum.xojo.com/user_avatar/forum.xojo.com/stefano_basile/32/1487_2.png) [@Stefano\_Basile](https://forum.xojo.com/u/Stefano_Basile)\
**Post date:** [September 13, 2022, 9:24am UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/5 "2022-09-13T09:24:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [September 13, 2022, 9:27am UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/6 "2022-09-13T09:27:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [September 13, 2022, 9:31am UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/7 "2022-09-13T09:31:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [September 13, 2022, 9:32am UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/8 "2022-09-13T09:32:05Z")

</div>

> WebContainer is the only way to go.

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [September 13, 2022, 9:39am UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/9 "2022-09-13T09:39:51Z")

</div>

Just in case third-party is on the table, [GraffitiTabPanel](https://demo2.graffitisuite.com/#tabpanel) allows adding tabs at runtime and a whole lot more.

---

<div class="post-metadata">

**Author:** ![Ricardo\_Cruz](https://forum.xojo.com/user_avatar/forum.xojo.com/ricardo_cruz/32/7852_2.png) [@Ricardo\_Cruz](https://forum.xojo.com/u/Ricardo_Cruz)\
**Post date:** [September 13, 2022, 10:02am UTC](https://forum.xojo.com/t/i-cannot-create-dynamic-instances-in-xojo-web-of-the-tabpanel1-object/72215/10 "2022-09-13T10:02:08Z")

</div>

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](https://tracker.xojo.com/xojoinc/xojo/-/issues/63119)
