DatePicker improperly overrides ID attribute when generating JS, breaking 
functionality.
----------------------------------------------------------------------------------------

                 Key: TAPESTRY-1985
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1985
             Project: Tapestry
          Issue Type: Bug
          Components: Core Components
    Affects Versions: 4.1.3, 4.1.2, 4.1.1, 4.1
         Environment: Firefox (1.5+, 2+), IE (5+), Windows XP 64, Ubuntu 
(Fiesty Fawn), AMD & Intel
            Reporter: Matthew Brock


The DatePicker script file is incorrectly using the component's getName() 
method to determine the client-side input field.  IDs that contain periods will 
break the script.

The offending code:
[org.apache.tapestry.form.DatePicker.script] Line 64:  var field = 
dojo.byId("${formName}").${name};

Example:
<input jwcid="@DatePicker" id="string.with.periods" value="startDate" />

According to the HTML spec 
(http://www.w3.org/TR/REC-html40/types.html#type-name):
"ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by 
any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons 
(":"), and periods (".")."

If the component sees an idParameter has been set, it should navigate directly 
to the field (e.g., dojo.byId("${idParameter}") -- if idParameter were included 
in the script map).  If the developer wants to specify their own ID, then let 
them worry about the constraints of ID uniqueness.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to