[
https://issues.apache.org/jira/browse/TAPESTRY-2394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594217#action_12594217
]
Chris Lewis commented on TAPESTRY-2394:
---------------------------------------
I disagree strongly with this decision because it makes it cumbersome to use
client-side code in a generic and non-intrusive manner. It's not hard to
imagine situations where it may be useful to attach client-side behavior to
link components - take the 'confirm' mixin from the wiki
(http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained) as an
example. Knowing the dom id is there provides a pipe that any mixin providing
client-side behavior can tap-in to, and is a nice bit of simple infrastructure
t5 can (used to) provide. Mixins adding such behavior shouldn't have to worry
about if the parent component (a self-declaring ClientElement) will have this
id - it should just be able to assume it and go about its business. I'll step
it up a notch and contend that it should not be left to the users to explicitly
include this hypothetical 'id' mixin to assure any subsequent mixins will work
correctly. Lastly I'll add that this (sudden) change to remove the ids based
soley on the presence of a zone as an optimization step feels an awful lot like
premature optimization. I sincerely hope this is reconsidered.
> clientid not rendered for pagelink or actionlink (with no zone parameter)
> --------------------------------------------------------------------------
>
> Key: TAPESTRY-2394
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2394
> Project: Tapestry
> Issue Type: Bug
> Components: Core Components
> Affects Versions: 5.0.12
> Environment: Any
> Reporter: Steven Woolley
> Assignee: Howard M. Lewis Ship
>
> the clientid is no longer rendered for pagelinks or actionlinks. The cause
> (from walking through the debugger) is this:
> For actionlinks:
> when there is no zone parameter, the call to getClientId() on the actionlink
> is never made, and thus the clientid is never rendered. Pagelink's simply
> never make a call to getClientId().
> This line in AbstractComponentEventLink's beginrender hilights the issue
> culprit:
> if (_zone != null) _clientBehaviorSupport.linkZone(getClientId(), _zone);
> For pagelinks, there is simply no call to getClientId() anywhere in its
> rendering.
> I just double checked, very latest snapshot from maven:
> http://tapestry.formos.com/maven-snapshot-repository//org/apache/tapestry/tapestry-core/5.0.12-SNAPSHOT/tapestry-core-5.0.12-20080428.110035-48.jar
> Test.java:
> package org.example.myapp.pages;
> public class Test {
> }
> Test.tml:
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <head><title>test</title></head>
> <body>
> <a t:id="addSongsToList" t:type="actionlink" ></a>
> </body>
> </html>
> renders:
> <html><head><link href="assets/tapestry/5.0.12-SNAPSHOT/default.css"
> rel="stylesheet" type="text/css"><title>test</title></head><body><a
> href="test.addsongstolist"></a></body></html>
> Same thing in a loop renders:
> <html><head><link href="assets/tapestry/5.0.12-SNAPSHOT/default.css"
> rel="stylesheet" type="text/css"><title>test</title></head><body><a
> href="test.addsongstolist"></a><a href="test.addsongstolist"></a><a
> href="test.addsongstolist"></a></body></html>
> And if I explicitly set the id="something":
> <html><head><link href="assets/tapestry/5.0.12-SNAPSHOT/default.css"
> rel="stylesheet" type="text/css"><title>test</title></head><body><a
> href="test.addsongstolist" id="something"></a><a href="test.addsongstolist"
> id="something"></a><a href="test.addsongstolist"
> id="something"></a></body></html>
> Also double checked in 5.0.11 and it works as expected:
> Test.tml:
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <head><title>test</title></head>
> <body>
> <t:loop source="1..3">
> <a t:id="addSongsToList" t:type="actionlink" ></a>
> </t:loop>
> </body>
> </html>
> renders:
> <html><head><link href="assets/tapestry/default.css" rel="stylesheet"
> type="text/css"><title>test</title></head><body><a href="test.addsongstolist"
> id="addSongsToList"></a><a href="test.addsongstolist"
> id="addSongsToList_0"></a><a href="test.addsongstolist"
> id="addSongsToList_1"></a></body></html>
--
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]