tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-2331) Can't stop tapestry generating clientId for fields
Date Fri, 30 May 2014 22:30:03 GMT

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

Hudson commented on TAP5-2331:
------------------------------

SUCCESS: Integrated in tapestry-trunk-freestyle #1224 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/1224/])
Fixes tests broken by the original implementation of TAP5-2331 (thiagohp: rev c24580586ce521e5bcbe09e7fba27e16f15cce9a)
* tapestry-core/src/main/java/org/apache/tapestry5/modules/InternalModule.java
* tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PreSelectedFormNamesService.java
* tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.java
* tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
* tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
* tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PreSelectedFormNamesServiceImpl.java
* tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java


> Can't stop tapestry generating clientId for fields
> --------------------------------------------------
>
>                 Key: TAP5-2331
>                 URL: https://issues.apache.org/jira/browse/TAP5-2331
>             Project: Tapestry 5
>          Issue Type: Bug
>            Reporter: Lance
>            Assignee: Thiago H. de Paula Figueiredo
>              Labels: month-of-tapestry
>             Fix For: 5.4
>
>
> I want to be able to specify a clientId so that tapestry doesn't auto-generate one for
me. This works on many core tapestry components when I specify an "id" because the following
code is present:
> {code}
> clientId = resources.isBound("id") ? idParameter : renderSupport.allocateClientId(resources);
> {code}
> But in AbstractField, this logic is different
> {code}
> @Parameter(value = "prop:componentResources.id", defaultPrefix = BindingConstants.LITERAL)
> private String clientId;
> final void setup() {
>    String id = clientId;
>    ...
>    assignedClientId = jsSupport.allocateClientId(id);
> }
> public final String getClientId() {
>    return assignedClientId;
> }
> {code}
> This means that tapestry will generate id's like "foo_af42a49d19a" after zone updates
when I set clientId to "foo". This makes it impossible to attach clientside behaviour by field
id selectors.
> As a workaround, I add "data-" attributes to my fields and select by them instead. I
assume this has worse performance than id based selectors.
> Forum thread [here|http://tapestry.markmail.org/search/?q=list%3Aorg.apache.tapestry.users#query:list%3Aorg.apache.tapestry.users+page:1+mid:ccqjgtopya3xdgrd+state:results]



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message