Jump to content

How to Get the input value within a Filter Event?


Recommended Posts

In an application I would like to use filter events to fill-up a table. The idea is to be able to decide what happens depending on the pressed keys, arrows, escape, etc. Additionally the input value should be checked so that depending on the row the input values are in the expected range or correspond to the expected type. This is the reason to use the filter event so that unwanted keys or characters can be discarded will doing the input.

The problem that I have is that when the Enter, or Return key is pressed to accept a value, the value has not been changed yet (because it is a filter event I guess).

The behaviour can be tested on the attached snippet. 

Is there a way to know the input value of the cell on the event?

 

I'm using LabVIEW 2014 SP1 3f 32 bit on Win10

Filter_Event_Example.png

Link to comment

The trick is to get the Edit Position first, set Key Focus to false, get the (now updated) value and process it, set Key Focus to true again and then restore the previous Edit Position.

For an application of mine I had to process arrows with and without modifiers, tabs and whatnot, sometimes jumping columns besides correcting the entered values, and allow only the input of [0-9] in some cells and text in others - you can go quite far in tweaking the standard table navigation behaviour if you invest time in implementing all cases.

Edited by ensegre
  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.