Interesting. Not safe to do such things in jython, if you don’t want to end up with un-openable windows. Unfortunately, that example code is not licensed in a way that could be cut and pasted into an Ignition module. /-:
I don’t need the complete filtering and highlighting like in the picture (which would be awesome)…
I have a list component filled with items.
What I need is, when user types in the text box for example letter ‘c’ that the list box highlights the first item which starts with ‘c’. Then user types ‘a’ and the list box highlights the text which starts with ‘ca’, then ‘r’ and list box highlights ‘car’ and so on…
I’ve done this in Ignition with power tables, but it should work with a list component too. The way I did it is by having a text box with Defer Updates and RejectUpdates boxes unchecked. I then place a power table underneath the box running a query like this
Select value From table Where value LIKE CONCAT(:text,'%')
the :text variable is bound to the text entry component. As you type it runs the query to select results that match. You could also concatenate another ‘%’ in front if you want to search for any combination of the input.
I also set the power table to be hidden, it becomes visible when you start typing in the text entry box, then it is hidden again when you click on a value in the power table. the click sets the text entry to the value you click on so you don’t have to finish all the typing to select a value.