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

Jochen Kemnade commented on TAP5-2500:
--------------------------------------

If we only have a single Heartbeat, we need another way to defer rendering 
tasks to the end of an iteration of a containing rendering task, e.g.
{code}
<t:loop source="list:[1,2]" />
  <t:label for="tf />
  <t:textfield id="tf"/>
</t:loop>
{code}
We cannot write the {{for}} parameter until after we have assigned a client id 
to the textfield, but we don't want to defer that to the end of the 
MarkupRendererFilter, because if we ded, all labels would get the id of the 
textfield in the last iteration of the loop component.
I recently fixed the TriggerFragment/FormFragment issue by allocation the 
client id on first access 
(https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=commitdiff;h=4a9b171531f9fa271cb540555ead87d6b7242cca)
 and resetting it in the AfterRender phase 
(https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=commitdiff;h=33f9e65b933654b32d4a67ef6dcbc6b357eb7393).
 If we did the same for AbstractField, that would probably solve your issue.
I'll also add a check for a {{null}} fieldId to the Label component, so this 
error doesn't go unnoticed at least.

> Label broken when inside zone and attached to a Field after that zone
> ---------------------------------------------------------------------
>
>                 Key: TAP5-2500
>                 URL: https://issues.apache.org/jira/browse/TAP5-2500
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: I D
>
> This is just one example, since the same problem is observed for 
> TriggerFrament inside a zone when used in conjunction with a FormFragment 
> outside the zone (and after it).
> {code:xml}
>     <t:zone t:id="myZone">
>         <t:label for="myField">Label</t:label>
>     </t:zone>
>     <t:textfield t:id="myField"/>
> {code}
> The reason this doesn't work is because Label.updateAttributes() uses 
> @HeartbeatDeferred and assumes this invocation will be deferred until the end 
> of the *page* render. Alas, since the label is inside a zone, which for some 
> reason starts and ends its own heartbeat (nested within, and occluding, the 
> page heartbeat), the invocation is deferred only until the end of the *zone* 
> render, i.e. - too early.
> Apparently this bug was introduced in [this 
> commit|https://github.com/apache/tapestry-5/commit/cc6fe5f3f85001eca4e0aa6a79c3bedc3e36b82c],
>  which in turn was addressing 
> [TAP5-940|https://issues.apache.org/jira/browse/TAP5-940].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to