# Preserving current tab when opening a dialog

**URL:** <https://forum.servoy.com/t/preserving-current-tab-when-opening-a-dialog/6014>\
**Category:** Classic Servoy\
**Created:** [May 31, 2006, 3:44pm UTC](https://forum.servoy.com/t/preserving-current-tab-when-opening-a-dialog/6014 "2006-05-31T15:44:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amason](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@amason](https://forum.servoy.com/u/amason)\
**Post date:** [May 31, 2006, 3:44pm UTC](https://forum.servoy.com/t/preserving-current-tab-when-opening-a-dialog/6014/1 "2006-05-31T15:44:40Z")

</div>

Hi,

When I open a dialog and then close it, the main form reverts to the first tabindex. Is there any way to make it preserve the tab it was in before the dialog was opened?

Thanks,

Andrew

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [May 31, 2006, 4:07pm UTC](https://forum.servoy.com/t/preserving-current-tab-when-opening-a-dialog/6014/2 "2006-05-31T16:07:04Z")

</div>

Servoy remembers the chosen tab. But: if you close a formInDialog, the onShow event of the underlying form will be fired. I suppose in that event, you jump to the first tab?

---

<div class="post-metadata">

**Author:** ![amason](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@amason](https://forum.servoy.com/u/amason)\
**Post date:** [May 31, 2006, 4:12pm UTC](https://forum.servoy.com/t/preserving-current-tab-when-opening-a-dialog/6014/3 "2006-05-31T16:12:04Z")

</div>

Yes, that’s the problem… Is there anyway to have the onShow event not fire?

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [May 31, 2006, 4:13pm UTC](https://forum.servoy.com/t/preserving-current-tab-when-opening-a-dialog/6014/4 "2006-05-31T16:13:09Z")

</div>

You are the programmer! Some people would fill a global (e.g. globals.blockOnShow) and ask for that global in the onShow event…

---

<div class="post-metadata">

**Author:** ![amason](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@amason](https://forum.servoy.com/u/amason)\
**Post date:** [May 31, 2006, 4:26pm UTC](https://forum.servoy.com/t/preserving-current-tab-when-opening-a-dialog/6014/5 "2006-05-31T16:26:16Z")

</div>

Fair enough 🙂 I thought maybe there was a condition in the showDialog() method or something. I can work with this though.
