[
https://issues.apache.org/struts/browse/WW-2809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46062#action_46062
]
Wes Wannemacher commented on WW-2809:
-------------------------------------
Markus,
The file you submitted is not necessarily a "patch," it is simply a new version
of the file. It is not the current file that we have released, plus, I tried to
incorporate your changes and it didn't quite work right. In the second select
box, with multiple turned on, the list was incomplete. If I get a chance, I
will look further into this and see if I can create a fix for this issue. If
you have time, try to checkout the struts source from SVN and try to make the
changes. If you are familiar with SVN and Apache Maven, it's pretty easy to
download and build from source. Then, generating a patch file that I can use is
a matter of doing `svn diff .` from the source tree. If you aren't an SVN /
Maven user, don't worry about it, I'll figure it out before the next release.
> doubleselect ignores preselection of a multiple subselect
> ---------------------------------------------------------
>
> Key: WW-2809
> URL: https://issues.apache.org/struts/browse/WW-2809
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.1.2
> Reporter: Markus Katz
> Priority: Minor
> Fix For: 2.1.7
>
> Attachments: doubleselect.ftl
>
>
> template/simple/doubleselect.ftl contains the following snippet to preselect
> the subselection:
> for (i = 0; i < ${parameters.id}Group[x].length; i++) {
> ${parameters.id}Temp.options[i] = new
> Option(${parameters.id}Group[x][i].text, ${parameters.id}Group[x][i].value);
> <#if parameters.doubleNameValue?exists>
> if (${parameters.id}Temp.options[i].value ==
> '${parameters.doubleNameValue}') {
> ${parameters.id}Temp.options[i].selected = true;
> selected = true;
> }
> </#if>
> }
> In the case of a multiple subselect the doubleNameValue is a collection of
> ids. In this case the single ...Temp.options[i].value is compared to a
> collection object which fails for all items.
> I´d suggest a patch like:
> for (i = 0; i < ${parameters.id}Group[x].length; i++) {
> ${parameters.id}Temp.options[i] = new
> Option(${parameters.id}Group[x][i].text, ${parameters.id}Group[x][i].value);
> <#if parameters.doubleNameValue?exists>
> <#if parameters.doubleMultiple?exists>
> for (j = 0; j <
> ${parameters.doubleNameValue}.length; j++) {
> if (${parameters.id}Temp.options[i].value ==
> ${parameters.doubleNameValue}[j]) {
> ${parameters.id}Temp.options[i].selected =
> true;
> selected = true;
> }
> }
> <#else>
> if (${parameters.id}Temp.options[i].value ==
> '${parameters.doubleNameValue}') {
> ${parameters.id}Temp.options[i].selected = true;
> selected = true;
> }
> </#if>
> </#if>
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.