Perspective Text Field Numeric Keypad

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.

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.

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

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

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.

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:

3 Likes

Thanks, I will check it out

1 Like

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.

1 Like

Yes, this will work on a touchscreen.

1 Like

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!

1 Like

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

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.

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.
1 Like

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). 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):
	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
def onMessageReceived(self, payload):
	owner = self.custom.ownerID
	if owner == payload['owner']:

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?

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.

1 Like

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?

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

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.