Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromecambon committed Dec 19, 2024
1 parent 7fd353d commit 81210a4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions modules/pages-and-forms/pages/widgets.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,36 @@ The URL points on a file without extension (e.g. \https://myhost/doc/sample)
[.solution]#Possible solution#
Make a custom widget from the File Viewer widget, and adapt the `controller.isPDF` or `controller.isImage`.
--

[.troubleshooting-title]
=== Troubleshooting Auto Complete

[.troubleshooting-section]
--
[.symptom]
Autocomplete widget does not update its displayed value

[.symptom-description]
Autocomplete widget does not update its displayed value when the value is changed by a variable.

[.solution]#Possible solution#
Make a custom widget from the Autocomplete widget, and Update the controller by replacing the function that set the formatLabel as follows:

[source,javascript]
----
this.formatLabel = function ($model) {
if (this.selectedItem) {
let sel = this.selectedItem;
this.selectedItem = undefined;
return this.getLabel(sel);
} else {
if (typeof $model === 'object') {
return this.getLabel($model);
} else {
return $model;
}
}
};
----
--

0 comments on commit 81210a4

Please sign in to comment.