03-04-2021 12:16 PM
Ctrl + V works fine, but paste using Runtime shortcut menu => Paste Data doesn't trigger value change event when I set the string control to "Update Value while Typing". It's the default shortcut menu.
Is this the expected behavior?
LabVIEW 20.0f1 32bit
Windows 7 Pro SP1 64bit OS
Currently, I'm using shortcut menu selected event in addition to value change event as workaround.
Solved! Go to Solution.
03-04-2021 03:27 PM
Works OK for me.
03-04-2021 03:39 PM
It seems there is one more condition:
the data is from the OS clipboard, copied from other applications.
If you use CopyData before PasteData, then it works.
Also tested on Windows 10, LabVIEW 2019
and Windows 7 Pro. LabVIEW 2014
03-05-2021 03:27 AM - edited 03-05-2021 03:32 AM
I can reproduce this easily (LV20, 64 bit).
Steps:
Make a new VI.
Put a string on my FP.
Set it to update while typing.
Add an event structure.
Change timeout event to the string's value change event.
Run the VI.
Copy text from notepad.
Select the "Paste Data" right click menu of the control.
The data is pasted, the event is not triggered.
Indeed, Copy Data followed by a Paste Data does trigger the event. CTRL+C from LabVIEW, then a Paste Data does not.
EDIT: However, Copy Data from another LabVIEW control, then by a Paste Data does trigger the event.
03-10-2021 12:08 PM - edited 03-10-2021 12:14 PM
When you use a right click context menu, that event is listed "Shortcut Menu Selection" in the Edit Events Window. This is a separate event setting from Value Change Event.
Setup the Shortcut Menu Selection and see what happens. Open your Event Inspector Window to see what event fire.
Opps, You already say your using Shortcut Menu Selection as a work around but its the correct way.
03-10-2021 12:29 PM
Thanks you for your opinion.
I'm using the shortcut menu event as a workaround. But it's not intuitive. Because value does change. So value change event should be triggered in addition to shortcut menu selection event.
Besides, value change event is the mostly used event, and already used in most case.
03-10-2021 03:10 PM
OK, after playing around with the Event Structure, even an Indicator wired inside the Structure reads old data. (I'm using a text indicator).
Create a Text Control value change event. Place a text indicator inside the Event Structure wired to a Text Control outside the Event Structure.
Make a new change each event your will see the values lag behind by 1 event. I'm using LV2019... I can't tell you if it should work this way, I didn't expect that.
You will see the NewVal ==String Control and OldVal == String Indicator... Since String Control is wired to Strin Indicator, I expected Control and Indicator to match. SMH.
03-11-2021 02:39 AM
@richjoh wrote:Opps, You already say your using Shortcut Menu Selection as a work around but its the correct way.
I hope you mean that is a correct workaround?
I don't see how this isn't a bug that needs to be fixed, if that's what you're saying.