[jira] Commented: (TAPESTRY-306) LinkSubmit doesn't respect Form's DOM id

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] Commented: (TAPESTRY-306) LinkSubmit doesn't respect Form's DOM id

JIRA tapestry-dev@jakarta.apache.org
     [ http://issues.apache.org/jira/browse/TAPESTRY-306?page=comments#action_65359 ]
Cherry Development commented on TAPESTRY-306:

In particular, this affects the javascript implementation in HTTPUnit, which is making my test code more fragile than I'd like, since it means I can't put an id tag on a form that has a LinkSubmit.  Since I have no control over the name attribute of a form, this will break my tests if the auto-generated name of the form ever changes.

Trivial fix:
LinkSubmit.java, in renderComponent:
String formName = form.getId() != null ? form.getId() : form.getName();

That should do it.  If the form has an id, it'll use it in the href='javascript:...' link, otherwise, it'll use the name.

> LinkSubmit doesn't respect Form's DOM id
> ----------------------------------------
>          Key: TAPESTRY-306
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-306
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Reporter: Cherry Development
>     Priority: Minor

> LinkSubmit does not seem to check to see if that the Form that it's embedded in uses a DOM id and therefore always refers to the from by its automatically generated name attribute, even though it should be referring to it by the user-defined DOM id instead.  Not all (any?) DOM environments will allow you to refer to an element by its name attribute when it also has an id assigned.
> This should be fairly trivial to fix.  I'd be more than happy to make the fix myself if you decide this issue should be resolved.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]