Java/JavaFX8: Perform action when input in TextField has certain length -
I currently use AutoComplete TextField functionality from ControlsFX when user shows suggestions during typing. The amount of suggestions is large, and therefore this list does not fit on the page.
I would like to set the length of the list of maximum wires, but it is not possible in the controller FX yet (as I can conclude). Therefore, I was thinking about an alternate solution, in which the list appears only when the user has typed 3 or more strings.
I have now set to execute this action when TextField is clicked (where search customer is my textfield):
@ FXML Private Zero Search client ) {// Get all customers from the store string [] [] customersofop = octocash.main.databaseConnection.getData ("some query", array.select ("some column names")); // Convert 2D array 1D array int noOfRows = customersOfShop.length; String [] customersForList = new string [noOfRows]; For (int k = 0; k How to do this in Java / javaFX8?
One way to see the duration of the text may be:
< Code> integer binding ib = tie. Length (textField.textProperty ()); Ib.addListener (ObservableValue & # 39; Enlarges Number & gt; Overview, Number Old, Current NewValue) - & gt; {if (newValue.intValue () & gt; = 3) {// Trigger auto complete} });
Comments
Post a Comment