Repository navigation
WW-5847 fix(core): preselect multiple values in the doubleselect second list - #2126
Merged
Merged
Conversation
…nd list With doubleMultiple set, the simple theme interpolated the bound value of the second list into the generated script unquoted, so a plain String became a bare identifier, a Collection rendered through toString, and a String[] failed the template. The branch was also selected by the attribute's presence, so doubleMultiple="false" took it. DoubleListUIBean now also exposes the value as a list of strings, and the template emits it as an array of quoted, JS-escaped string literals, the same way the single-value branch and the option values are already written. The branch is selected by the attribute's boolean value. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
lukaszlenart
marked this pull request as ready for review
November 7, 2026 19:35
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes WW-5847
With
doubleMultipleset, the simple theme'sdoubleselect.ftlinterpolated the bound value of the second list into the generated script unquoted. A plainStringbecame a bare identifier and the script failed on page load, aCollectionrendered throughtoStringwith the same result, and aString[]failed the template render. The branch was also chosen by the attribute's presence, sodoubleMultiple="false"took it too.Change
DoubleListUIBeanresolves the second list's value once and also exposes it as a list of strings (doubleNameValues), normalised from aString, aCollectionor an array throughMakeIterator.var <id>Selected = [...], an array of quoted, JS-escaped string literals written the same way the single-value branch and the option values already are, and the preselect loop compares against it.doubleMultiple.The xhtml theme includes the simple template and picks the change up; the html5 theme renders a placeholder for this tag and is unchanged.
Compatibility
Preselecting several values in the second list works. The single-value path renders exactly as before; the existing
DoubleSelect-*fixtures are unchanged.Tests
DoubleSelectMultipleTestcovers aCollection(full fixtureDoubleSelect-7.txt), aString, aString[], values containing quotes, backslashes and a closing script tag rendering as string literals, anddoubleMultiple="false"taking the single-value path. Fullcoresuite green.🤖 Generated with Claude Code