Hello.
Using a combobox is not an option, because it preloads all the data.
I solved the problem this way:
...
htmlAttributes: { openhelper: "off"},
open: function() {
if (this.value !== null) {
this.value = null;
this.htmlAttributes["openhelper"] = "on";
}
},
close: function() {
if (this.value === null && this.htmlAttributes["openhelper"] === "on") {
this.showPopup();
this.htmlAttributes["openhelper"] = "off";
}
}
...
The htmlattribute "openhelper" is being used to track if a user clicks on "open" and then clicks on "close" without selecting a value.
In the open handler, I check if a selected value exists. If this is the case, I set the value to null (which causes CLOSE to be called) and I set the htmlattribute "openhelper" to ON.
In the close handler, I check if the current value is null and if the htmlattribute "openhelper" has been set to "ON". If this is the case, I show the popup.
If the htmlattribute "openhelper" is not set to "ON" the user has clicked on the close button without selecting an item. In that case I don´t call showpopup again.
Works pretty well.
It would be nice to have such a behavior of the autocomplete control natively available.
All the best,
Florian