The flex repeater passes in a "secret" index parameter. The index number is the array number.
Figure 1. The instance index.
On the repeated view add the index
parameter. I've set it to -1 so I know if it is the test value or the real index value.
Figure 2. Add the index parameter on the subview.
Now,
Pass the index parameter to your keypad popup.
Include the index number in the keypad sendMessage.
On the subview message handler check the index number.
Figure 3. The subview message handler.
I might not have the scope set correctly in Figure 3.
It's in the manual but would be hard to find if you didn't know what to look for. Perspective - Flex Repeater | Ignition User Manual
Tip :
Message: Massage:
Hi
I am traying this way but now no value display.
I can't understand.
Can you give me brief example?
Please share your valuable feedback
I have added Index in PARMS of
Please refer above Images.
You posted the images from post #40 again in post #42 . Please don't do that unless you are including new information.
There is a pencil link below each of your posts so you can edit it. You don't need to write a new post to say, "Please refer above images."
Figure 4. Delete all of these.
The index parameter is supplied automatically.
It looks like label = index + 1
so you can calculate that on the view.
Figure 5. Calculating the label number from the index parameter.
Figure 6. You have no code for when the index is correct!
Refre to fig 6.
Can you give me some script.
I am new in ignition.
I dont understand what code write in in massage handler.
Can i replace owner with index in 1st image that i send you fast
Have you read the documentation and watched the videos on the page below?
The easier solution is something someone else mentioned that should fix it (I'll update my Exchange submission with this update/fix as well, but for now, make the following changes:
Add a custom value property under the existing keypad custom property named "ownerId" (should look like this):
Change the onMouseDown event script on the numeric entry to:
self.custom.keypad.ownerId = str(system.date.toMillis(system.date.now()))
owner = self.custom.keypad.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)
Change the keypadReturn message handler to use this instead:
if self.custom.keypad.ownerId == payload['owner']:
self.props.value = float(payload['value'])
Similar changes can be made to the other keypad popups, but this should hopefully solve your issue.
Hi Michael & Transistor,
Thank you Very much. My issue is solved.
DinMun
May 21, 2024, 6:22pm
51
Hi,
I've followed your guide and I've got to the point where the numpad is popping up but, after pressing Enter, my new value doesn't register.
Most likely, you're missing something. Check everything in my example view (Test Keypads) especially the mouseDown event and the keypadReturn message handler script. The event passes the owner to the keypad so that it can properly return the value. Then the message handler script sets the value of the component to the value returned from the keypad. If you're missing either one, it won't work.
DinMun
June 25, 2024, 4:00pm
53
So the issue turned out to be spacing in the script.
When I first copied your script from your post above, it looked like this:
After fixing the spacing, it worked: