0

We are upgrading JSF 1.2 to 2.2 and we have hundreds of JSF files with duplicate IDs, and those IDs are used in Java code also. If we change these in the JSF files, we will need to change them in so many places.

How can we have JSF allow duplicate IDs in .html files?

JonathanDavidArndt
  • 2,518
  • 13
  • 37
  • 49
Raj
  • 2,463
  • 10
  • 36
  • 52
  • 2
    I think you are out of luck and you have to bite the apple... – Kukeltje Jul 15 '16 at 12:12
  • This is not allowed. You can use, for example, naming containers at appropriate places like `` to mitigate the effect of duplicate ids (or perhaps, composite components, if they are suitable to your requirements). – Tiny Jul 16 '16 at 13:01
  • I don't know if it helps but if you are using component ids only for partial update and submit and use Primefaces framework then you can refer to components by their css classes (jquery style) which can be duplicate. See [Primefaces documentation](http://www.primefaces.org/docs/guide/primefaces_user_guide_6_0.pdf) Paragraph 4.3.2 PrimeFaces Selectors (PFS) – Artem Jul 22 '16 at 12:04

1 Answers1

0

Duplicate IDs are not allowed in JSF 2.2


From the documentation:

https://www.ibm.com/support/knowledgecenter/en/SSAW57_8.5.5/com.ibm.websphere.nd.multiplatform.doc/ae/rweb_jsfengine.html

JonathanDavidArndt
  • 2,518
  • 13
  • 37
  • 49