I would like to use a variable value for the id of my components. That is, use:
<h:panelGrid id="unique_id_#{bean.value}" rendered="#{bean.boolValue}" >
<!-- stuff -->
</h:panelGrid>
instead of:
<h:panelGrid id="unique_id"
But, even though I can trace the call to bean.value, the value assigned to the id is: unique_id_
I'm expecting it to be something like unique_id_1123. Also If I try id="#{bean.value}" , the app server (Glassfish) gives error: javax.servlet.ServletException: Empty id attribute is not allowed
The other attributes in the component that use the bean behave as expected, such as the rendered attribute.
But, Im guessing, the id value is getting computed before bean is assigned. Are there any special rules about when id attribute values are evaluated?
Notes:
The h:panelGrid component is within a ui:repeat component, which assigns the bean from a list of
Java beans.
I'm using
JSF core, facelets, html as well as the primefaces component library.
Hope this is clear (??) Let me know if not, or if I can provide more detail.
And many thanks for any tips/advice.
Colm.