# tabStrip PropertyChange

**URL:** <https://forum.inductiveautomation.com/t/tabstrip-propertychange/17717>\
**Category:** Ignition\
**Created:** [April 15, 2018, 4:50am UTC](https://forum.inductiveautomation.com/t/tabstrip-propertychange/17717 "2018-04-15T04:50:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinel37461](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@martinel37461](https://forum.inductiveautomation.com/u/martinel37461)\
**Post date:** [April 15, 2018, 4:50am UTC](https://forum.inductiveautomation.com/t/tabstrip-propertychange/17717/1 "2018-04-15T04:50:33Z")

</div>

Does anyone have a way to interrupt a tabStrip change from happening?  
I have a tabstrip with Navigation Mode = Disabled.  
When the user clicks another tab, I want to prompt the user to save their data before the tab change takes place.

I’ve tried using a propertyChange script:

```auto
if event.propertyName == 'selectedTab':
	userResponse = system.gui.confirm('Do you want to save your edits before leaving "%s"'%event.oldValue, 'Save?', False)
	if userResponse:
		# save data OR prevent the tab from changing so user can decide...
	else:
		pass # allow the tab to change

```

The tab change takes place before the message is displayed.  
I’ve also messed around with mousePressed and mouseClicked but I can’t find a way to prompt the user before the tab change has already completed.

TIA for suggestions.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 15, 2018, 1:31pm UTC](https://forum.inductiveautomation.com/t/tabstrip-propertychange/17717/2 "2018-04-15T13:31:18Z")

</div>

What do you mean by “the tab change has already completed”? If you have Nav Mode disabled, the tabstrip isn’t going to open any windows for you, that’s all that’s disabled.  
Consider adding a custom string property to your tabstrip, something like “acceptedTab”, and use that in all of your bindings instead of selectedTab. Your propertyChange script would then look like this:

```auto
if event.propertyName == 'selectedTab' and event.source.acceptedTab != event.source.selectedTab:
	userResponse = system.gui.confirm('Do you want to save your edits before leaving "%s"'%event.oldValue, 'Save?', False)
	if userResponse:
		# prevent the tab from changing so user can decide...
		event.source.selectedTab = event.source.acceptedTab
	else:
		pass # allow the tab to change
		event.source.acceptedTab = event.source.selectedTab

```

---

<div class="post-metadata">

**Author:** ![martinel37461](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@martinel37461](https://forum.inductiveautomation.com/u/martinel37461)\
**Post date:** [April 16, 2018, 1:02pm UTC](https://forum.inductiveautomation.com/t/tabstrip-propertychange/17717/3 "2018-04-16T13:02:14Z")

</div>

Thank you.  
Changing the bindings to a custom property does what I wanted.
