# Perspective Text Field Numeric Keypad

**URL:** <https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 17, 2023, 1:59pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229 "2023-03-17T13:59:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 17, 2023, 1:59pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/1 "2023-03-17T13:59:21Z")

</div>

Does anybody know how to enable a numeric keypad on perspective?  
We are using a touch screen as HMI, perspective does not have any built-in numeric keypads, maybe because perspective is web-browser based.  
Has anybody found a way to enable a numeric keypad on perspective?  
Thanks

---

<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:** [March 17, 2023, 2:07pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/2 "2023-03-17T14:07:23Z")

</div>

IiRC, there's a current bug causing this when the spinner is disabled. Try enabling the spinner on your fields.

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 17, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/3 "2023-03-17T14:45:11Z")

</div>

I enable spinner, but that is an arrow up and down.  
There is no numeric keypad.  
It would be so hard for operator to operate on a touch screen.

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [March 17, 2023, 2:55pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/4 "2023-03-17T14:55:40Z")

</div>

If you're on a Windows device, have you had any luck with the On-Screen Keyboard? I know it seems to be [a little buggy](https://forum.inductiveautomation.com/t/calling-up-the-windows-on-screen-keyboard-from-perspective-session/64959/9) in itself, but might work for you.

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 17, 2023, 3:01pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/5 "2023-03-17T15:01:12Z")

</div>

I will try that.  
If perspective has a popup for it would be nice.  
Perspective is making it harder for people to build HMI.

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [March 17, 2023, 3:03pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/6 "2023-03-17T15:03:39Z")

</div>

I'll agree with you that Perspective doesn't seem to be quite there for HMI yet.  
I still prefer Vision for actual machine interfaces, and Perspective for dashboards and information displays for engineering/management.

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 17, 2023, 3:44pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/7 "2023-03-17T15:44:52Z")

</div>

I totally agree with you.  
Just my client asked for Perspective, and giving me some templates of faceplates that do not work.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 17, 2023, 8:39pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/8 "2023-03-17T20:39:03Z")

</div>

I built this [Exchange resource](https://inductiveautomation.com/exchange/1521) ages ago, and I've just submitted an updated version for use in newer Ignitions version. The 1.0.0 version did not allow for anything other than integer values and required use of an Embedded View. The newer (1.1.0 - pending review) version supports double/float values and can be used in Popups or Docked Views. I'll update the instructions once the new version has been approved.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [March 19, 2023, 3:40pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/9 "2023-03-19T15:40:57Z")

</div>

I also created/modified a resource for keyboard/keypad if you want to give it a shot.

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2380/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 27, 2023, 1:41pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/10 "2023-03-27T13:41:45Z")

</div>

Michael:  
Thank you very much.  
I will try this one.

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 27, 2023, 3:14pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/11 "2023-03-27T15:14:43Z")

</div>

It does not work. I had to cast oldvalue to string to get it to show value.  
I am using pop-up, copied tag path directly to the parameter of pop-ups, then I had to caststring the oldvalue binding.  
Do know where and how you enter the value to owner tag, do not know where to cast it.  
I also tested using your test textfield, it did not work either.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [March 27, 2023, 3:41pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/12 "2023-03-27T15:41:31Z")

</div>

I just re-tried it and it's working fine on my laptop running the latest 8.1.26 even without having to cast anything. You might check your events on the text field or numeric field (whichever one you're using) and make sure everything in there looks normal. You shouldn't be using tag paths in the popParams but only doing a bi-directional binding of the text property (or value property on numeric entry) on the component directly. The event script should stay as it is and configure everything through the component custom properties.

```auto
def runAction(self, event):
	popParams = {'owner': self.meta.name, 'oldValue': self.props.text, 'initCaps': self.custom.keypad.initCaps, 'titleCase': self.custom.keypad.titleCase, 'isPassword': self.custom.keypad.isPassword}
	posit = None if self.custom.keypad.centerScreen else {'left': event.clientX, 'top': event.clientY}
	system.perspective.openPopup('keypadPopup-' + self.meta.name, 'Exchange/Keypad/Alphanumeric Popup', title=self.custom.keypad.title, params=popParams, position=posit, showCloseIcon=True, draggable=True, resizable=True, viewportBound=True, modal=True, overlayDismiss=True)

```

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [March 31, 2023, 8:16pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/13 "2023-03-31T20:16:53Z")

</div>

> [@michael.flagler](#):
>
> ```auto
> popParams = {'owner': self.meta.name, 'oldValue': self.props.text, 'initCaps': self.custom.keypad.initCaps, 'titleCase': self.custom.keypad.titleCase, 'isPassword': self.custom.keypad.isPassword}
> posit = None if self.custom.keypad.centerScreen else {'left': event.clientX, 'top': event.clientY}
> system.perspective.openPopup('keypadPopup-' + self.meta.name, 'Exchange/Keypad/Alphanumeric Popup', title=self.custom.keypad.title, params=popParams, position=posit, showCloseIcon=True, draggable=True, resizable=True, viewportBound=True, modal=True, overlayDismiss=True)
> 
> ```

I honestly don't know how you do it.  
Your script is not even a popup navigation. I could not get anything popup.  
If I use a popup navigation, numeric keypad shows up with tag value, but when I change value hit enter, nothing happens.

What do you put in owner and oldvalue parameters.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [March 31, 2023, 8:52pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/14 "2023-03-31T20:52:48Z")

</div>

The code I pasted there shouldn't be touched. The event script pulls everything it needs from the component's properties.

In my example:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/a/4a25ed2402592b33d9c05b3d65ffa9e7d6554f65.png)

Then the binding for the component's value should be bidirectional (are you missing this?) and configure the inputBounds minimum and maximum:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/9/69d034acfd2610497fa6efda739adc95c4bb16e9.png)

The last line of the script is calling the popup using the popParams as well as other configuration.

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [April 3, 2023, 1:06pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/15 "2023-04-03T13:06:13Z")

</div>

> [@Simen\_Minerd](#):
>
> > [@michael.flagler](#):
> >
> > ```auto
> > em.perspective.openPopup('keypadPopup-' + self.meta.name, 'Exchange/Keypad/Alphanumeric Popup', title=self.custom.keypad.title, params=popParams, position=posit, showCloseIcon=True, draggable=True, resizable=True, viewportBound=True, modal=True, overlayDismiss=True)
> > 
> > ```
> 
> I h

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c6056cbd5b921e4fa774bb70d02199d9eca6ff5c.png)  
Are you using Script or Popup when you create event for the numeric entry.

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [April 3, 2023, 1:10pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/16 "2023-04-03T13:10:15Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/4/74c7b34ce37e5c0347626d120787e16618a34155.png)  
I were to use Popup, what should I assign to "owner" and "oldValue"

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [April 3, 2023, 7:33pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/17 "2023-04-03T19:33:10Z")

</div>

I don't recommend using the popup event action as you'll have to manually configure it every time. For instance, in this screenshot, I just dropped a NumericEntryField on the root container as a test, but had to configure it manually with all of the parameters (units not shown in screenshot, but is there at the bottom if you were to scroll down).

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/b/abe8b5990972e037a9cbd8a6ec83798d25f7a406.png)

If you leave it as the script, you don't have to do anything in the script to make it work as it's all using "self.\_\_\_\_\_" so it automatically pulls in all of the information. The best way is to copy whichever input field you need and paste it into wherever you need it, but you can do it manually as well to add it to anything existing using my script action (copy/paste without any changes), adding the message handler script named "keypadReturn" with the exact script it has as well, along with the custom properties I have on the component itself. This allows you to modify the keypad by just configuring the component in the property editor to make the keypad work as needed.

---

<div class="post-metadata">

**Author:** ![ott.andrew33](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ott.andrew33/32/44625_2.png) [@ott.andrew33](https://forum.inductiveautomation.com/u/ott.andrew33)\
**Post date:** [April 4, 2023, 1:10pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/18 "2023-04-04T13:10:03Z")

</div>

Thanks for creating this! Exactly what I needed and works really well. Nice work and great README!

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [April 4, 2023, 7:40pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/19 "2023-04-04T19:40:35Z")

</div>

Thanks for explaining.  
I just cannot get it to work.  
I did exactly the same, I can press number keys, and it displays whatever number press on the keypad, but when I press "enter", nothing happens. the number does not transfer to the tag.  
I Have no what I've done wrong.  
I actually tried configured the same way before you show me details, I was reading your script to configure it.  
It seems other people can make it work, I just cannot.

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [April 4, 2023, 7:57pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/20 "2023-04-04T19:57:09Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/62e7aa484eb88215d0084e1fcdd446120ab1acc9.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/1/41a318b5dccb38ae7f5b91dbb03a2ef17f6f11ff.png)

[Next page](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229.md?page=2)
