Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
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:
clientId = resources.isBound("id") ? idParameter : renderSupport.allocateClientId(resources);
But in AbstractField, this logic is different
@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; }
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