# 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:** 2

<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 4, 2023, 8:09pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/21 "2023-04-04T20:09:27Z")

</div>

Don't use the popup action. Use the script and copy/paste it exactly as I have done.  
Also, just try copying my numeric entry field from my example and drop it on your view and it should work as is.

Edit: Also in your screenshot, you have a 10 in front of your minimum value, so it's breaking it. Also make sure your minimum value is set to some value that you want as your minimum.

Edit 2: If your text is red, that means the number is outside of the min/max range.

---

<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, 9:00pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/22 "2023-04-04T21:00:01Z")

</div>

I change the min and max value on the tag. They are not this issue. I can type in value within the rang. It just did not transfer the value. The tag is bidirectional. I will try the script way.

---

<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, 9:04pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/23 "2023-04-04T21:04:06Z")

</div>

I tried click on, click down, on performant. Non of them popup the screen.

---

<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, 9:04pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/24 "2023-04-04T21:04:57Z")

</div>

Thank you for helping replying every time I really appreciate it. Perspective is so strange.

---

<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 4, 2023, 9:07pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/25 "2023-04-04T21:07:05Z")

</div>

Have you tried just setting up a page to link directly to my example view to make sure it's working? If it doesn't work, I'd re-import everything again to make sure nothing is broken in all the testing.

---

<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 5, 2023, 3:03am UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/26 "2023-04-05T03:03:44Z")

</div>

I made a blog post demonstrating the installation and configuration steps of @michael.flagler's solution. In the blog post is a short video walking through the steps to add this keypad.

Check out the blog post below:

> **[Perspective Keypad Instructions](https://aott33.github.io/2024/07/25/perspective-keypad.html)**
>
> The goal of this blog is to help build my Automation Software Engineer (SASE) skillset by learning in public.

---

<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 5, 2023, 12:23pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/27 "2023-04-05T12:23:26Z")

</div>

Thanks, I will check it out

---

<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 5, 2023, 12:55pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/28 "2023-04-05T12:55:52Z")

</div>

Andrew:  
Thank you so much.  
It works now. I going to make a numeric entry library, so I do not have to create everything every time.  
In case people read this topic and have the same issue, I want to explain why this time it works.  
I notice Andrew modify the script, and he also created costume objects.  
Without the handle, the script will not work; I did not create any handles before seeing Andrew's instruction; I thought about it but did not know what name it should be.

Andrew, I have one more question have you try on a touch screen? Does "OnMouseDown" equal to touch on a touch screen? I don't have a Touch Screen to try right now.

Thanks to everybody.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 5, 2023, 1:09pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/29 "2023-04-05T13:09:25Z")

</div>

> [@Simen\_Minerd](#):
>
> Andrew, I have one more question have you try on a touch screen? Does "OnMouseDown" equal to touch on a touch screen? I don't have a Touch Screen to try right now.

Yes, this will work on a touchscreen.

---

<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 5, 2023, 1:16pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/30 "2023-04-05T13:16:30Z")

</div>

Thank you.  
I also created a close button on the numeric popup, it is easier to close the popup with a big button.  
My library works too, now I can just drag this numeric entry field to where I want.  
Thank you soooooooo much!

---

<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 5, 2023, 2:33pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/31 "2023-04-05T14:33:35Z")

</div>

If you don’t mind, can you share what you are doing with the library?

---

<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 5, 2023, 6:47pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/32 "2023-04-05T18:47:25Z")

</div>

Because for Numeric Popup Keypad to work, I need to create a handle and an event script; to save time, I created a Flex Container. Inside the container, there is a numeric entry with popup handle and script. At the root of this container, I created some Parameters, these parameters will be used by the numeric entry. These parameters are bind to value and name and other thing of the Numeric Entry.  
Every time when I need a numeric entry, I pull it from my library, not from the built in component. All I need to do just copy tag path to the parameters, or type in description in the parameters.

---

<div class="post-metadata">

**Author:** ![jimschaefer](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jimschaefer](https://forum.inductiveautomation.com/u/jimschaefer)\
**Post date:** [June 2, 2023, 4:57pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/33 "2023-06-02T16:57:48Z")

</div>

Thanks for this, it should be a feature included in the base ignition package either as component features or new components (numeric entry with keypad for example)

Reasons:

- Many systems have only touchscreens, especially for simple machine control and parameter setting
- keyboards break, get dirty and get stuck keys. This is a nice alternative when that happens

A few suggestions:

- when typing values instead of pressing buttons, pressing enter key should enter and close the popup
- pressing escape key will close the popup
- add a big close button to the pad
- add ability to enter scientific notation
- make it a simple selection property on numeric entry and text entry components. Don't require the user to do all that scripting if they don't need any customization.

---

<div class="post-metadata">

**Author:** ![jimschaefer](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jimschaefer](https://forum.inductiveautomation.com/u/jimschaefer)\
**Post date:** [June 6, 2023, 12:59pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/34 "2023-06-06T12:59:17Z")

</div>

After more work with this control I found a couple of significant areas for improvement.

First, I noticed that if you click on a number button then follow it by pressing the enter key it will repeat the last number. I was expecting that the enter key would post the message with the final value and close the form. This is a major shortcoming in my mind. I tried to fix this but found that the mouse click and enter generate the same onClick event and I could not find a way to distinguish betweeen the two. (see this post [Button events - how to tell difference between mouse click and pressing enter](https://forum.inductiveautomation.com/t/button-events-how-to-tell-difference-between-mouse-click-and-pressing-enter/74607)). I'd really love to see a solution for this !

Second, I used the keypad popup on a numeric control in a template (using the VIsion terminology) that I repeated several times on another screen. Whenever I entered data into one numeric field it updated all the instances on the page !

The solution I devised was to create a unique id for each instance of the template by using the time the popup was opened (thanks to a suggestion I found on another post).

- I added a custom property called "ownerID" to the numeric control
- I modified the numeric control "onMouseDown" event to use the system.date.time.now() in milliseconds as a unique ID (this should be unique since there is usually only one mouse click at a time on a page):

```auto
	popupOpenedTime = str(system.date.toMillis(system.date.now()))
	self.custom.ownerID = popupOpenedTime
	owner = self.custom.ownerID
	popParams = {'owner': owner, 'min': self.props.inputBounds.minimum, 'max': self.props.inputBounds.maximum, 'oldValue': self.props.value, 'units': self.custom.keypad.units}	
	posit = None if self.custom.keypad.centerScreen else {'left': event.clientX, 'top': event.clientY}	
	system.perspective.openPopup('keypadPopup-' + owner, 'Exchange/Keypad/Numeric Popup', title=self.custom.keypad.title, params=popParams, position=posit, showCloseIcon=True, draggable=True, resizable=True, viewportBound=True, modal=True, overlayDismiss=True)
	

```

- I modified the "keypadReturn" message handler on the numeric control to reference the "ownerID" now used in the payload

```auto
def onMessageReceived(self, payload):
	owner = self.custom.ownerID
	if owner == payload['owner']:

```

---

<div class="post-metadata">

**Author:** ![Tyler\_Britt](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@Tyler\_Britt](https://forum.inductiveautomation.com/u/Tyler_Britt)\
**Post date:** [March 4, 2024, 6:43pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/35 "2024-03-04T18:43:13Z")

</div>

I was able to get michael.flagler's solution to work for one of my numeric entry fields. I followed the same process for a second numeric entry field and it's not working. When I try to just copy and paste the numeric entry the value selected for one is copied to the other (if I type in "555" to one field it auto populates "555" in the other). Does anyone have any suggestions on how to fix this?

---

<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 4, 2024, 9:58pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/36 "2024-03-04T21:58:44Z")

</div>

Make sure your value binding on the numeric entry field isn't bound to the same tag. Otherwise, that's the only thing that should be causing them to show the same value as they check the self.meta.name (name of the component) to make sure they're only using the value from the appropriate entry for when there's more than 1.

---

<div class="post-metadata">

**Author:** ![Tyler\_Britt](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@Tyler\_Britt](https://forum.inductiveautomation.com/u/Tyler_Britt)\
**Post date:** [March 13, 2024, 3:10pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/37 "2024-03-13T15:10:26Z")

</div>

This got it fixed! I had it bound to the same tag from when I copied and pasted. Is there a way to limit the amount of digits the user can enter on this keypad?

---

<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 13, 2024, 4:42pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/38 "2024-03-13T16:42:35Z")

</div>

I believe I have a min/max value if I recall, but otherwise I don't think there's any limit.

---

<div class="post-metadata">

**Author:** ![Abhijit\_Jagtap1](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@Abhijit\_Jagtap1](https://forum.inductiveautomation.com/u/Abhijit_Jagtap1)\
**Post date:** [March 23, 2024, 9:21am UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/39 "2024-03-23T09:21:41Z")

</div>

Hii.

I am traying to Numeric keypad open in Flex repeater, but on that time, I am facing one issue which is I have Write value for 1st repeater but all repeater showing same value.  
what code I write for individual value in Massage handler.  
I am traying Assign row name for differentiation but that time only popup open, but value does not pass.  
In My whole project we have used flex repeaters.  
I have extremely struggle for find solution Please help me.

---

<div class="post-metadata">

**Author:** ![Abhijit\_Jagtap1](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@Abhijit\_Jagtap1](https://forum.inductiveautomation.com/u/Abhijit_Jagtap1)\
**Post date:** [March 23, 2024, 9:30am UTC](https://forum.inductiveautomation.com/t/perspective-text-field-numeric-keypad/71229/40 "2024-03-23T09:30:40Z")

</div>

![Image3](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/967855866bca86e9bc156563e8051ef001e5a292.png)  
 ![Image2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/9/691d51f868740335d8295b9f3ae2a7d66e1ff906.png)  
 ![Image1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/2/a24f607159f838ac540fe06836ef9323f67d410b.png)

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

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