You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Volker Weber (JIRA)" <de...@myfaces.apache.org> on 2017/04/29 08:19:04 UTC

[jira] [Commented] (TOBAGO-1736) Incorrectly rendered component ID

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

Volker Weber commented on TOBAGO-1736:
--------------------------------------

Hi David,

i don't think this is a tobago issue, nor it can be anything done inside tobago to solve this.

The problem here is the c:forEach loop with dynamic changed content between rerendering the same view.

Let me try to explain the behavior:
The facelet engine is reusing the existing components as long as the component matches the required types.
The ValueExpression for the id is resolved on component creation and set into the Component instance.
When rerendering the same view with another order of the forEach values, the component tree is the same
as before, just the values of the ValueExpressions are changed. The ids of the components are rendered in the old order,
but the values in the new order.

Maybe someone with better knowledge of the spec ([~lu4242] ?) could say if this behavior is a bug or required by the spec.
  
Regards,

    Volker


> Incorrectly rendered component ID
> ---------------------------------
>
>                 Key: TOBAGO-1736
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-1736
>             Project: MyFaces Tobago
>          Issue Type: Bug
>          Components: Facelets
>    Affects Versions: 2.0.10
>         Environment: Unix
>            Reporter: David Crhonek
>         Attachments: uploadBox.xhtml
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> When dynamically creating UI component ID, the rendered ID is often incorrect. This appears to be random, but happens very often, multiple times on a page. When the same value is put in ID and in tip (title), the rendered title is ALWAYS correct, however the rendered ID value is often INCORRECT.
> In the attached example, #{titleVar} is put to ID as well as to tip. This is an example of an incorrect output:
> <button type="button" name="page:details_upload:CASV3_C_B_TODAY" id="page:details_upload:CASV3_C_B_TODAY" title="NTC_A_B_TODAY" data-tobago-commands="{&quot;click&quot;:{&quot;partially&quot;:&quot;page:details_upload:popup-Upload-TODAY-1&quot;,&quot;popup&quot;:{&quot;command&quot;:&quot;open&quot;}}}" href="#" data-tobago-style="{&quot;width&quot;:&quot;59px&quot;,&quot;height&quot;:&quot;14px&quot;,&quot;top&quot;:&quot;52px&quot;,&quot;left&quot;:&quot;677px&quot;,&quot;position&quot;:&quot;absolute&quot;}" class="tobago-button" style="width: 59px; height: 14px; top: 52px; left: 677px; position: absolute;"><span>Upload</span></button>
> ID and Title should be the same, but they are not. The expected value is NTC_A_B_TODAY



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)