You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Thomas Andraschko (Jira)" <de...@myfaces.apache.org> on 2023/10/30 09:24:00 UTC

[jira] [Comment Edited] (MYFACES-4623) DuplicateIdException when adding component with resource in JSTL tag handler

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

Thomas Andraschko edited comment on MYFACES-4623 at 10/30/23 9:23 AM:
----------------------------------------------------------------------

[~volosied] will you port to 4.0?


was (Author: tandraschko):
[~volosied] will you port to 4.0 and 4.1?

> DuplicateIdException when adding component with resource in JSTL tag handler
> ----------------------------------------------------------------------------
>
>                 Key: MYFACES-4623
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4623
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 4.0.1
>            Reporter: Manuel K
>            Priority: Major
>             Fix For: 4.1.0, 5.0.0
>
>
> The following error occurs when a JSF component adding a resource is added in a JSTL tag handler:
> {code:java}
> org.apache.myfaces.view.facelets.compiler.DuplicateIdException: Component with duplicate id "j_id__rd_5" found. The first component is {Component-Path : [Class: jakarta.faces.component.UIViewRoot,ViewId: /test.xhtml][Class: org.apache.myfaces.component.ComponentResourceContainer,Id: jakarta_faces_location_head][Class: jakarta.faces.component.UIOutput,Id: j_id__rd_5]}
>     at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.createAndQueueException(CheckDuplicateIdFaceletUtils.java:139)
>     at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(CheckDuplicateIdFaceletUtils.java:95)
>     at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(CheckDuplicateIdFaceletUtils.java:109)
>     at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(CheckDuplicateIdFaceletUtils.java:103)
>     at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(CheckDuplicateIdFaceletUtils.java:81)
>     at org.apache.myfaces.view.facelets.PartialStateManagementStrategy.saveView(PartialStateManagementStrategy.java:701)
>     at jakarta.faces.application.StateManager.getViewState(StateManager.java:147)
> [...]{code}
> In our example, the resource that is apparently added to the component tree twice is _inputmask/inputmask.js_ of the _p:calendar_ component when using it in a {_}c:forEach{_}.
> The error only happens if _STRICT_JSF_2_FACELETS_COMPATIBILITY_ is enabled, but that is a requirement for our application. The error does not occur in Mojarra.
> I would appreciate you looking into this, as it is a pretty big problem for us. And before you ask: We're using c:forEach because in our application changing from c:forEach/c:if to ui:repeat/ui:fragment would result in an increase of components in the component tree by a factor of about 5 on some sites.
> I could copy and paste more of the code here, but I think it's easier to just look at the reproducer: [https://github.com/mkomko/primefaces-test/tree/inputmask-duplicateid]
> The error occurs when opening the dialog using the button and then clicking "Cancel".
> Thank you very much in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)