• Post Reply Bookmark Topic Watch Topic
  • New Topic

IllegalStateException - Duplicate id

Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Facelets, Apache Faces and Tomoahawk technologies. Tag Prefixes have been changed "F" so please ignore.

I have a page called client_details.xhtml and it includes another called contact_details.xhtml. Here is the source :

<f:include src="../contact_details.xhtml"/>

Every time I edit the value and save it produces the following exception :

java.lang.IllegalStateException: Duplicate id : ContactBean_homePhone. Child could not be added.
at javax.faces.component._ComponentChildrenList.checkAddAllowed(_ComponentChildrenList.java:95)
at javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:76)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:176)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:54)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:165)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)

Note that it has a problem with the ContactBean..., if I remove the above include line it works.
I understand that there must be component already defined on the page which it conflcits with, however, the name given to this component is not automatically assigned by JSF by I have assigned it a name and shown in code extract :

<td class="fieldHdr">Home Phone</td>
<td class="fieldText"><apm:inputText id="ContactBean_homePhone" maxlength="20" value="#{ContactBean.homePhone}" /> </td>
<td class="fieldHdr">Home Fax</td>
<td class="fieldText"><apm:inputText
id="ContactBean_homeFax" maxlength="20" value="#{ContactBean.homeFax}" /></td>
In the above , if I remove the homePhone the fax number and run again, the fax number becomes the problem field instead.

I just would like some direction of how or where I could look to solve this problem.

Is it that I need to supply an id on something else or ??

Really would appreciate somefeedback however small.

David O'Meara
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Glenn
Can you remove the underscore form your display name please? Display names must be your first name, a space, then your last name.

You can update your profile url=http://www.coderanch.com/forums/user/edit]here[/url].


PS I was going to call you last week, but I lost your phone number
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!