LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multicom Listbox input control

Hey All, I've got a few questions regarding multicom listboxes

 

My biggest one is on input controls. What is the easiest way to set up a listbox so a user can only insert numbers into the cells?

 

Bonus round:

I want to pass data from one listbox to another, is the only way to do that with the individual property nodes?

0 Kudos
Message 1 of 7
(3,120 Views)

I had a similar issue once where I wanted a user to enter a calibration due date. To avoid having to deal with a multitude of different ways to indicate a date I used an interface with a calendar control to select the date, I was then assured that the date will always have the same format. The user select the row and click the Modify button.

 

You can do something similar where the user select a number from a numeric control, then you convert it to a string before writing the value to the MCL.

 

Ben64

 

Update MCL using Dialog.png

Message 2 of 7
(3,093 Views)

What do you want to happen if the user inserts something else?

 

The way that I can think of is to have an event for the filter event 'Edit Cell?' and then parse the string after the change. If it matches your conditions, wire false to the discard event and your parsed string to the String output. If it doesn't, wire true to discard. No edit will be made.

 

A simple example (allowing 'yes', but nothing else) is below as a snippet.

 

editCell.png


GCentral
Message 3 of 7
(3,083 Views)

Ok, that's pretty close to what I'm looking for. Any chance you could show me a block diagram with the basic elements of your solution?

0 Kudos
Message 4 of 7
(3,074 Views)

I'm guessing that you meant Ben's solution, since mine was drag-droppable, but I'd guess and say what he has is a 'dialog' window style VI with an event structure using the events 'OK: Value Change' and 'Cancel: Value Change' and outputting a cluster or string array of data values, possibly along with a boolean to say if the dialog was cancelled/accepted, and if needed a local variable in the 'OK' event case to output the changed values, with the 'Cancel' event case just wiring the control right through to a hidden indicator.


GCentral
Message 5 of 7
(3,069 Views)

Here's a very simplified version, the original uses an xml file to keep track of the data. The example uses an express dialog box but the original uses a custom dialog vi that load the current selected MCL row values into the dialog box. In the original you can also add, insert and delete rows and print the list.

 

You can use the example as a starting point, I did it rapidly so there's probably a lot of room for improvement.

 

Ben64

Message 6 of 7
(3,064 Views)

Here's a trick I use sometimes when I want a cell to have special behavior.

"If you weren't supposed to push it, it wouldn't be a button."
Message 7 of 7
(3,062 Views)