• Post Reply Bookmark Topic Watch Topic
  • New Topic

Empty id attribute is not allowed

 
George Schrader
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use an el expression as the id of a h:selectOneRadio element of a JSF. I am using the same expression in other parts of the page just fine, but when I use it in the id of the h:selectOneRadio element I get a "Empty id attribute is not allowed" error. Any help would be greatly appreciated.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post your code?

Maybe your id is declared like id=""
 
George Schrader
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code:

 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure but I guess that JSF does not allow your ID to have a #{} command.

Why are you doing this?
 
Louis Bros
Ranch Hand
Posts: 54
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Wouldn't the id go in the selectItem's parent element?

If you're trying to style the selectItems you can use enabledClass, disabledClass, border or layout.

What's the error?

Louis
 
George Schrader
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error is "Empty id attribute is not allowed". For some reason it is not picking up the value of the expression even though it does in other parts of the JSF. This is within a datatable and so the id is dynamically set to the value of the question.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
George Schrader wrote:This is within a datatable and so the id is dynamically set to the value of the question.


Check this link: http://stackoverflow.com/questions/316790/dynamic-ids-in-jsf-seam
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!