Skip to content

Commit

Permalink
Merge pull request #1950 from scireum/feature/mbo/OX-10886
Browse files Browse the repository at this point in the history
Fixes button for multiple selections to behave correctly
  • Loading branch information
scireum-mbo authored Mar 13, 2024
2 parents 9956511 + df0c793 commit 7773ab7
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/main/resources/default/taglib/t/lookupValues.html.pasta
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@
<a class="btn btn-outline-secondary" id="@id-addon"><i class="fa-solid fa-bolt"></i></a>
</i:block>
<i:block name="script">
const helper = document.getElementById('___id-addon');
helper.addEventListener('click', function () {
new LookupTableInfo({
tableName: '___table',
labelFormat: '___values.getDisplay()',
codeCallback: function (code, name) {
autocomplete.addToken({value: code, text: name});
}
const helper = document.getElementById('___id-addon');
helper.addEventListener('click', function () {
new LookupTableInfo({
tableName: '___table',
labelFormat: '___values.getDisplay()',
codeCallback: function (code, name) {
if (!autocomplete.val().includes(code)) {
autocomplete.addToken({value: code, text: name});
} else {
autocomplete.select.removeTokenWithText(name);
}
}
});
});
});
</i:block>
<i:for var="tuple"
type="Tuple"
Expand Down

0 comments on commit 7773ab7

Please sign in to comment.