# Clear on exit or Enter

**URL:** <https://forum.inductiveautomation.com/t/clear-on-exit-or-enter/3197>\
**Category:** Ignition\
**Created:** [August 19, 2011, 2:46pm UTC](https://forum.inductiveautomation.com/t/clear-on-exit-or-enter/3197 "2011-08-19T14:46:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [August 19, 2011, 2:46pm UTC](https://forum.inductiveautomation.com/t/clear-on-exit-or-enter/3197/1 "2011-08-19T14:46:05Z")

</div>

I have a tab strip I use to switch between screens. Some of the screens have drop down selection boxes on them. I like that the selection stays while user is using the screen. If they select a tab and come back it is still at last selection. I would like it to go back to the default of “Select Value” either on exit of screen or entry into screen. I do not see where to do this…Grrrrrr

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [August 19, 2011, 3:45pm UTC](https://forum.inductiveautomation.com/t/clear-on-exit-or-enter/3197/2 "2011-08-19T15:45:49Z")

</div>

If you set an expression binding on the Selected Value property of the dropdown list, it will be evaluated every time the screen is opened. The expression “-1” (without the quotes) will return it to each time.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [October 4, 2011, 7:43pm UTC](https://forum.inductiveautomation.com/t/clear-on-exit-or-enter/3197/3 "2011-10-04T19:43:39Z")

</div>

Let’s say we are using this dropdown for a filter. The dropdown is correctly populated buy whatever dataset is assigned. When you first come to the page the “” text is in the dropdown and nothing is filtered. If you change to an item in the dropdown the filter works using the newly selected value. The problem is that I can’t find a way to reset/reselect an empty/"" value unless I leave the page and return.

Is there a way to add this empty Selected String Value to the dropdown list?

I had the same question as the OP, with the selected value not resetting when leaving. I posted here because I wanted to take the same question one step farther.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [October 4, 2011, 7:52pm UTC](https://forum.inductiveautomation.com/t/clear-on-exit-or-enter/3197/4 "2011-10-04T19:52:24Z")

</div>

There are two ways you can get back to the ‘’ state.

1. You can add a button to the right of the dropdown list that sets the selectedValue to -1 which clears the selection.

2. If the data property is bound to a SQL query you can add a ‘’ state to it like this:`SELECT -1 AS ID, '<Select One>' AS Label
UNION
SELECT col AS ID, col2 AS Label FROM table
ORDER BY ID ASC, Label ASC`

---

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [October 5, 2011, 11:45am UTC](https://forum.inductiveautomation.com/t/clear-on-exit-or-enter/3197/5 "2011-10-05T11:45:22Z")

</div>

Travis,

I used option “1”. The users liked it, they have more control of when things get cleared.
