You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (Created) (JIRA)" <de...@myfaces.apache.org> on 2011/09/27 03:22:12 UTC

[jira] [Created] (MYFACES-3331) Identifier stored on MARK_CREATED should be unique per component on the same

Identifier stored on MARK_CREATED should be unique per component on the same
----------------------------------------------------------------------------

                 Key: MYFACES-3331
                 URL: https://issues.apache.org/jira/browse/MYFACES-3331
             Project: MyFaces Core
          Issue Type: Sub-task
          Components: JSR-314
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


Suppose this use case:

    <c:if test="...">
        <testComposite:simpleComposite/>
    </c:if>
    <testComposite:simpleComposite/>

If c:if condition is first false and then it is true, the id for the second component will be assigned to the first one. The effect is c:if add/remove/refresh algorithm gets confused. Later if the value changes back to false, the component that is removed will be the other that is not expected. At the end the state of one component is lost.

The algoritm that generate that identifier must meet at minimal two conditions.

1. They should be unique but
2. The same ids should be generated each time the view is built for comply with c:if addition/removal algorithm.

Additionally, considering this use case:

<h:outputText value="-A-"/>
<ui:include src="#{pageSelected}"/>
<h:outputText value="-C-"/>

page1.xhtml:

<ui:composition>
<h:outputText value="-B-"/>
</ui:composition>

page2.xhtml:

<ui:composition>
<h:outputText value="-B-"/>
</ui:composition>

We need to ensure this condition:

3. Different ids should be generated for components in different.

To ensure two pages with the same components in this configuration can be associated with different ids, it is necessary to keep track of the facelet hierarchy.

How to solve it?

First create a "hierarchical counter" that can generate something like this:

1
2
3
4
5_1
5_2_1
5_2_2
5_2_3
5_3

The proposal I'm working on is create a counter like this:

[hierarchical counter]_[faceletHierarchy_prefix]_[tagId]

And use two hierarchical counters, one for the previous id and the other one for the component generated id.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MYFACES-3331) Identifier stored on MARK_CREATED should be unique per component on the same

Posted by "Leonardo Uribe (Resolved) (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3331.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.4
                   2.0.10
    
> Identifier stored on MARK_CREATED should be unique per component on the same
> ----------------------------------------------------------------------------
>
>                 Key: MYFACES-3331
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3331
>             Project: MyFaces Core
>          Issue Type: Sub-task
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.10, 2.1.4
>
>
> Suppose this use case:
>     <c:if test="...">
>         <testComposite:simpleComposite/>
>     </c:if>
>     <testComposite:simpleComposite/>
> If c:if condition is first false and then it is true, the id for the second component will be assigned to the first one. The effect is c:if add/remove/refresh algorithm gets confused. Later if the value changes back to false, the component that is removed will be the other that is not expected. At the end the state of one component is lost.
> The algoritm that generate that identifier must meet at minimal two conditions.
> 1. They should be unique but
> 2. The same ids should be generated each time the view is built for comply with c:if addition/removal algorithm.
> Additionally, considering this use case:
> <h:outputText value="-A-"/>
> <ui:include src="#{pageSelected}"/>
> <h:outputText value="-C-"/>
> page1.xhtml:
> <ui:composition>
> <h:outputText value="-B-"/>
> </ui:composition>
> page2.xhtml:
> <ui:composition>
> <h:outputText value="-B-"/>
> </ui:composition>
> We need to ensure this condition:
> 3. Different ids should be generated for components in different.
> To ensure two pages with the same components in this configuration can be associated with different ids, it is necessary to keep track of the facelet hierarchy.
> How to solve it?
> First create a "hierarchical counter" that can generate something like this:
> 1
> 2
> 3
> 4
> 5_1
> 5_2_1
> 5_2_2
> 5_2_3
> 5_3
> The proposal I'm working on is create a counter like this:
> [hierarchical counter]_[faceletHierarchy_prefix]_[tagId]
> And use two hierarchical counters, one for the previous id and the other one for the component generated id.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira