02-19-2013 11:50 AM - edited 02-19-2013 11:51 AM
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
Solved! Go to Solution.
02-19-2013 12:00 PM
See if this does what you want: http://forums.ni.com/t5/LabVIEW/Darren-s-Weekly-Nugget-04-27-2009/td-p/896977
02-21-2013 11:39 AM
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.
02-21-2013 03:13 PM
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).
02-21-2013 05:38 PM - edited 02-21-2013 05:45 PM
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. 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?
02-21-2013 05:47 PM
You can load the list of strings programmatically. Did you look at my post, and note the "Strings" property node?
03-08-2013 08:54 AM
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?
03-08-2013 01:00 PM
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.