LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make a text box that has autosuggestion?

Solved!
Go to solution

I want to have a text box on the front panel that has a limited number of suggestions, the way Google search does.


The situation: We have a bunch of parts we sell. So, say someone starts typing into the box, "AE"; the autosuggestion dropdown list then shows our parts with that text: "AEF1355, AES5135, AEN6425," etc. That's what we want. And no, this text box will have nothing to do with the block diagram.

 

Thanks in advance!

-Michael

0 Kudos
Message 1 of 8
(5,668 Views)
0 Kudos
Message 2 of 8
(5,660 Views)

It sounds like he's talking about what I want, but the code that he has to download is only a text box with nothing in the block diagram. It doesn't automatically fill anything I type into it. I also saw the code he has later on in his images (such as the one below), but I don't exactly understand what he's doing in it.

 

 

If there is no preset code, I would be extremely grateful if someone were willing to walk me through how to set up an auto-suggest box with a preset list of possible suggestions that can appear, as I described in my initial post.

 

0 Kudos
Message 3 of 8
(5,597 Views)

The textbox from that link is actually a combobox (which has been modified to hide the drop-down arrow, as explained in the post). You can preset a list of items using the Strings property node. The auto-complete functionality is built into the combobox. Try the attached snippet (or recreate it yourself using a combobox) and see how it works. Note the snippet tool makes a mess of property nodes; the explicit one here should be replaced with an implicit one (right-click the combobox terminal, create property node for the Strings property).

autocomplete.png

0 Kudos
Message 4 of 8
(5,580 Views)

Ah! Okay, I figured out that I can right-click on the auto-complete block, then choose Properties, then select "Edit Items."

 

But then that's where the problem lies. I have 2,000 different items I want to have on that Items list. Smiley Frustrated lol... There doesn't seem to be any other way to get that done with this particular sub-VI other than manually typing every single one of those in!

 

I wonder what other options are out there?

0 Kudos
Message 5 of 8
(5,568 Views)

You can load the list of strings programmatically. Did you look at my post, and note the "Strings" property node?

0 Kudos
Message 6 of 8
(5,561 Views)

Well, as a Labview noob, I can get as far as setting up the string property node, but the 2,000 elements I speak of are in a database. It appears that on your code you put your own list of strings on there (the 1, 2, 3 string).

 

How do I stream those elements into a ready-to-go array on Labview, so I can cram all of those into a Auto-correct box's preset list?

0 Kudos
Message 7 of 8
(5,513 Views)
Solution
Accepted by topic author bonbonbaron

Ah, now you're asking a completely different question, which is "how do I load a list of strings from a database into a LabVIEW array?" You could write some code to query the database; you could export the list from the database to a text file and load that in your LabVIEW program; you could hire an intern to retype the whole list into an array constant. Lots of options, but given the information you provided I can't give you a more detailed answer.

Message 8 of 8
(5,499 Views)