struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Jesús García de Soria Lucena (JIRA) <j...@apache.org>
Subject [jira] [Issue Comment Edited] (WW-2750) JavaScript errors due to hyphens in action names
Date Fri, 26 Aug 2011 10:58:35 GMT

    [ https://issues.apache.org/jira/browse/WW-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13091702#comment-13091702
] 

Juan Jesús García de Soria Lucena edited comment on WW-2750 at 8/26/11 10:57 AM:
---------------------------------------------------------------------------------

We've hit this and we have a patch that escapes hyphens, colons and dots to underscores in
the id before using it as an identifier for javascript variables and functions.

We've also taken the liberty to make the BR tag between the selects absent when the label
is left-placed, so that the css-xhtml theme would have a better appearance.

We also changed the way in which the second control is located, by using ['id'] instead of
.id, to address the same concerns.

We've also removed a redundant loop used for determining the selected option, moving it to
the loop that's generating the option data.

UPDATE: I forgot to mention that the patch should also allow for null values in the lists.

      was (Author: skandalfo):
    We've hit this and we have a patch that escapes hyphens, colons and dots to underscores
in the id before using it as an identifier for javascript variables and functions.

We've also taken the liberty to make the BR tag between the selects absent when the label
is left-placed, so that the css-xhtml theme would have a better appearance.

We also changed the way in which the second control is located, by using ['id'] instead of
.id, to address the same concerns.

We've also removed a redundant loop used for determining the selected option, moving it to
the loop that's generating the option data.
  
> JavaScript errors due to hyphens in action names
> ------------------------------------------------
>
>                 Key: WW-2750
>                 URL: https://issues.apache.org/jira/browse/WW-2750
>             Project: Struts 2
>          Issue Type: Improvement
>    Affects Versions: 2.0.11.2
>            Reporter: Miguel Diaz
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: fix-doubleselect-for-ids-containing-non-id-chars.patch
>
>
> Action names may include some characters (such as hyphens) that cannot be part of a JavaScript
variable name.
> In form related tags, the action name is used as a part of the generated HTML tag name
and/or id.
> This causes invalid JavaScript when a HTML tag name/id is used as part of a JavaScript
variable, such as in <s:doubleselect> generated JavaScript (an, I think, also in JavaScript
validation code, but I'm not sure).
> A simple fix would be replacing all prohibited characters with underscores in the generated
HTML tags names and ids.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message