Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF1007: Duplicate component ID j_id10 found in view

 
B Nirvan
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting this error when I try to load my JSF page.



I am really cluless about this error. I am using PrimeFaces 2.2, Mojarra 2.0.3, Netbeans 6.9, Hibernate JPA.

regards,
Nirvan
 
Binnie Fabian
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Day,


Based on the error message itself, you got duplicate id's in your jsf page.

Try to search for id's that are the same then change one.



Regards,

Binnie
 
B Nirvan
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ids are generated by the JSF framework (I haven't provided them) and I believe that they will be uniquely generated for each component in the View. Can we question the framework here ? Another point to emphasize is that I am using Primefaces which work with JSF.

regards,
Nirvan.
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Try giving Id to all components in your view..and check whether is there any commandlink or commandbutton out of form.


Thanks,
Mahendra
 
Mariusz Choda
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ID's should be unique in each jspx/jsf/xhtml page. Regarding cited error please read this article: JSF1007
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18169
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have "awakened a zombie". It's been about 3 years since anyone posted to this thread. In this industry at this time, it's even odds that all the original participants have moved on to other jobs and other projects. Even me, although I've kept the JavaRanch position for quite a while.

Component IDs do not need to be unique within the View Definition, just within a given naming container. Those containers must have unique ID within their parent naming containers (if any) and so on all the way up. The net result is that the generated HTML ID is unique, even though the JSF View Template Language ID is not.

However, the complaint here had to do with discrepancies that come from when the View Template does not contain an explicit ID and system-generated IDs (j_xxxxx) are created. JSF can get out of sync on those when a page is refreshed, which is why the first recommendation is to give stuff explicit IDs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic