{"action":"created","issue":{"url":"https://api.github.com/repos/jfoenixadmin/JFoenix/issues/220","repository_url":"https://api.github.com/repos/jfoenixadmin/JFoenix","labels_url":"https://api.github.com/repos/jfoenixadmin/JFoenix/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/jfoenixadmin/JFoenix/issues/220/comments","events_url":"https://api.github.com/repos/jfoenixadmin/JFoenix/issues/220/events","html_url":"https://github.com/jfoenixadmin/JFoenix/issues/220","id":199296439,"number":220,"title":"Autocomplete on JFXComboBox","user":{"login":"woprzech","id":9087726,"avatar_url":"https://avatars2.githubusercontent.com/u/9087726?v=4","gravatar_id":"","url":"https://api.github.com/users/woprzech","html_url":"https://github.com/woprzech","followers_url":"https://api.github.com/users/woprzech/followers","following_url":"https://api.github.com/users/woprzech/following{/other_user}","gists_url":"https://api.github.com/users/woprzech/gists{/gist_id}","starred_url":"https://api.github.com/users/woprzech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woprzech/subscriptions","organizations_url":"https://api.github.com/users/woprzech/orgs","repos_url":"https://api.github.com/users/woprzech/repos","events_url":"https://api.github.com/users/woprzech/events{/privacy}","received_events_url":"https://api.github.com/users/woprzech/received_events","type":"User","site_admin":false},"labels":[{"id":257791944,"url":"https://api.github.com/repos/jfoenixadmin/JFoenix/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-06T21:43:09Z","updated_at":"2018-02-27T20:35:36Z","closed_at":"2018-02-23T20:00:31Z","author_association":"NONE","body":"Is there any way to turn on autocomplete on JFXComboBox? I know that there is option to call:\r\n```java \r\nTextFields.bindAutoCompletion(comboBox.getJFXEditor(), \"option1\", \"option2\");\r\n```\r\nbut appearance of autocomplete from ControlsFx:\r\n![image](https://cloud.githubusercontent.com/assets/9087726/21733498/24bbdb8c-d45f-11e6-9d8b-003017e85888.png)\r\nand ComboBox from JFoenix\r\n![image](https://cloud.githubusercontent.com/assets/9087726/21733511/3c1f9d68-d45f-11e6-8c33-cb5efc813325.png)\r\nare completly diffrent.\r\n\r\nIt would be great to have this little option integrated too 😃"},"comment":{"url":"https://api.github.com/repos/jfoenixadmin/JFoenix/issues/comments/369017248","html_url":"https://github.com/jfoenixadmin/JFoenix/issues/220#issuecomment-369017248","issue_url":"https://api.github.com/repos/jfoenixadmin/JFoenix/issues/220","id":369017248,"user":{"login":"Jetlagh","id":36899757,"avatar_url":"https://avatars2.githubusercontent.com/u/36899757?v=4","gravatar_id":"","url":"https://api.github.com/users/Jetlagh","html_url":"https://github.com/Jetlagh","followers_url":"https://api.github.com/users/Jetlagh/followers","following_url":"https://api.github.com/users/Jetlagh/following{/other_user}","gists_url":"https://api.github.com/users/Jetlagh/gists{/gist_id}","starred_url":"https://api.github.com/users/Jetlagh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jetlagh/subscriptions","organizations_url":"https://api.github.com/users/Jetlagh/orgs","repos_url":"https://api.github.com/users/Jetlagh/repos","events_url":"https://api.github.com/users/Jetlagh/events{/privacy}","received_events_url":"https://api.github.com/users/Jetlagh/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T20:35:36Z","updated_at":"2018-02-27T20:35:36Z","author_association":"NONE","body":"After a glance at the JFXChipView (specifically [JFXChipViewSkin](https://github.com/jfoenixadmin/JFoenix/blob/master/jfoenix/src/main/java/com/jfoenix/skins/JFXChipViewSkin.java) and [JFXAutoCompletePopup](https://github.com/jfoenixadmin/JFoenix/blob/master/jfoenix/src/main/java/com/jfoenix/controls/JFXAutoCompletePopup.java)), the JFXAutoCompletePopup can be used on a JFXComboBox in this way:\r\n\r\n```Java\r\nJFXComboBox<String> comboBox = new JFXComboBox<>();\r\ncomboBox.getItems().addAll(\"HELLO\", \"TROLL\", \"WFEWEF\", \"WEF\");\r\n\r\nJFXAutoCompletePopup<String> autoCompletePopup = new JFXAutoCompletePopup<>();\r\nautoCompletePopup.getSuggestions().addAll(comboBox.getItems());\r\n\r\n//SelectionHandler sets the value of the comboBox\r\nautoCompletePopup.setSelectionHandler(event -> {\r\n    comboBox.setValue(event.getObject());\r\n});\r\n\r\nTextField editor = comboBox.getEditor();\r\neditor.textProperty().addListener(observable -> {\r\n    //The filter method uses the Predicate to filter the Suggestions defined above\r\n    //I choose to use the contains method while ignoring cases\r\n    autoCompletePopup.filter(item -> item.toLowerCase().contains(editor.getText().toLowerCase()));\r\n    //Hide the autocomplete popup if the filtered suggestions is empty or when the box's original popup is open\r\n    if (autoCompletePopup.getFilteredSuggestions().isEmpty() || customerComboBox.showingProperty().get()) {\r\n        autoCompletePopup.hide();\r\n    } \r\n    else {\r\n        autoCompletePopup.show(editor);\r\n    }\r\n});\r\n```\r\n\r\nI did not test it with JFXTextField but I assume this is even easier as you do not have to worry about the ComboBox popup, or for instance synchronizing the ComboBox items with the Suggestions (which I did not do in this simple example). Please note that the autocomplete popup's default skin is different than the ComboBox's popup skin."}}
{"actor":{"display_login":"Jetlagh"}}