# Perspective button in view stays in pressed state

**URL:** <https://forum.inductiveautomation.com/t/perspective-button-in-view-stays-in-pressed-state/41332>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 9, 2020, 9:39am UTC](https://forum.inductiveautomation.com/t/perspective-button-in-view-stays-in-pressed-state/41332 "2020-12-09T09:39:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [December 9, 2020, 9:39am UTC](https://forum.inductiveautomation.com/t/perspective-button-in-view-stays-in-pressed-state/41332/1 "2020-12-09T09:39:05Z")

</div>

I have created an application to track our internal IP address usage. It features a button in a view (_render: veiw, viewPath: viewPingButton_) which opens a popup which runs the ping test.

![Ping button select](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/3/336c34a6e58deb29492030fa6b448fb7b74deb6a.png)

The problem is that after the popup has been closed the button can’t be pressed a second time unless the user clicks elsewhere on the table to de-select the cell’s rendered view. The column is set to _editable: false_. It’s as though the button is being held down and needs to have the focus removed from it.

Any ideas?

* * *

For anyone interested, the popup looks like this:

![Ping popup](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/4/1432b7d748f9f10d68ad7344cea8c9518ff4f38c.png)

The red label is _lblPingStatus_ and has a custom prop _pingResult_ which is used to control the caption and color.

and the code like this:

```auto
def runAction(self):
	self.getChild("lblPingStatus").custom.pingResult = -1	# Suppress any previous results.
	self.getChild("lblHelper").meta.visible = False
	
	import datetime
	import os # Required for ping operation
	import re # Required to strip leading zeros from IP address octets.
	
	timeout = 1500 # ping timeout (ms).

	shortIp = re.sub('(^|\.)0+(?=[^.])', r'\1', self.view.params.value.IpAddress) # Strip the leading zeros from each octet or Windows ping won't find it!	
	# For Windows: -n 1 = ping once. -w 200 = timeout value.
	# r = os.system('ping -n 1 -w ' + str(timeout) + ' ' + shortIp) == 0 # Python method superceded.
	# os.system('ping -c 1 {}'.format(myip)) See https://stackoverflow.com/questions/23661900/python-os-systemping-argument-not-working
	r = os.system('ping -n 1 -w ' + str(timeout) + ' {}'.format(shortIp)) == 0
	# 1 = Good.
	# 0 = Nothing.	
	self.getChild("lblPingStatus").custom.pingResult = r   
	if r == 0:
		self.getChild("lblHelper").props.text = 'No response in ' + str(timeout) + ' ms'
		self.getChild("lblHelper").meta.visible = True,

```
