Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1409118

Summary: [GSS](6.4.z) Mojarra 2.1.x / 2.2.x: If a CC contains fix ID's an ajax request results in duplicate ids
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Oscar Molina <omolinab>
Component: JSFAssignee: Peter Palaga <ppalaga>
Status: CLOSED NOTABUG QA Contact: Jan Kasik <jkasik>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4.7CC: bmaxwell, cdewolf, jstefl, mcada, ppalaga, rhatlapa, tmiyargi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-07 16:02:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test App
none
WAR application to test
none
Server log file with the errors none

Description Oscar Molina 2016-12-29 16:38:37 UTC
Created attachment 1235900 [details]
Test App

Description of problem:
JSF Mojarra 2.1.x and 2.2.x are not able to handle ajax request (which change the size of the iterating list) correctly if the list is iterated by JSTL. If the id of the composite component is fix, it results in a duplicate ID Error else no errors.

Version-Release number of selected component (if applicable):
EAP 6.4.11
Mojarra 2.1.x and 2.2.x

How reproducible:
This is reproducible in a JBoss EAP 6.4.11 in standalone mode.

Steps to Reproduce:
1. Build the attached test app (jsfbug-jboss.zip) with maven. This will generate jsfbug-jboss.war (It is attached to this ticket).
2. Put jsfbug-jboss.war to your deploy directory
3. Start JBoss
4. Access http://localhost:8080/jsfbug-jboss/index.xhtml with your browser
5. Click on a radio button.

Actual results:
This will provoke an error in the rendering. You can found an error such as the following in the logs:

~~~
SEVERE javax.enterprise.resource.webcontainer.jsf.application - JSF1007: Duplicate component ID j_idt5:j_idt19:input found in view.
~~~

Expected results:
No errors and working 

Additional info:
Removing all fix ids on CC's is not a way we can go depending on valueChangeListeners which are provided on some more complex CC's in our application and need a reference on a fix id.
This example works in apache-myfaces 2.1.x.

Comment 1 Oscar Molina 2016-12-29 16:39:25 UTC
Created attachment 1235901 [details]
WAR application to test

Comment 2 Oscar Molina 2016-12-29 16:40:16 UTC
Created attachment 1235902 [details]
Server log file with the errors

Comment 3 Oscar Molina 2016-12-30 14:46:43 UTC
A workaround would be to plugin in apache myfaces. However some customers can only use supported SW.

Comment 10 Brad Maxwell 2017-02-07 16:02:36 UTC
Closing as not a bug, if JSTL is mixed with JSF, then you should ensure the IDs are unique, as JSF will automatically generate ids, but JSTL does not, thus the issue.

https://java.net/jira/browse/JAVASERVERFACES-2323 - Id is not rendered for InputTextarea:  c:forEach shouldn't really be used if ids are needed

https://java.net/jira/browse/JAVASERVERFACES-2548 - ids cannot be set within a c:forEach: if ids are needed, the user is responsible for guaranteeing uniqueness