JavaServer Faces : java.lang.IllegalStateException: Component ID has already been found in the view. How resolve ?

Firstly you really need validate your code, because this error says that you have two components with the same ID . Some times don’t have any  duplicated id in my file, so what I can do now ? How resolve this problem?

The best way and the first tip is: You need only set value for id attributes where is really necessary. Why ?

The framework will auto-generate a unique values for ids, but it happens only when you don’t set any value in id attribute .

To  know more you can look in the documentation of the responsible method for do this :

When I need use the ID and Name attributes ?

In the big part of the cases, it’s only happens if you need call the component. One example of this is when you want update some component after some event.


<p:selectOneMenu  style="width:150px"

    <f:selectItems value="#{myController.takeAllObjects()}"
    <p:ajax event="change" process="@this" update="otherPanel"/>
<h:panelGroup id="otherPanel">

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s