0

Currently I am using a rich:dataTable to loop through records. I simply output the text like this:

<h:outputText value="#{property.variableName}" />

This displays the data properly in the table. Now I want to add IDs to test my stuff. I tried adding the same property as the ID like this:

<h:outputText id="#{property.variableName}" value="#{property.variableName}" />

The result is an empty ID error. I prepended it with "id_" and all that gets returned to the DOM is "id_" (no property variableName) added to it.

Am I losing my mind? I feel as if this should work as I've done it in the past.

CodeMonkey
  • 160
  • 9
  • I managed to work around my issue by using the "alt" parameter instead of "id". For some reason it evaluates there. If anyone else is reading this and knows why I would get such behavior please feel free to educate me :) – CodeMonkey May 22 '15 at 18:11
  • 1
    What is the purpose of assigning an `id` a dynamic value? It is not available in your use-case because an `id` associated with any JSF component is evaluated during view build time. Thus, any EL being evaluated for an `id` has to be available during view build time (using ``, for example) which might not be available at view build time in your case (as you said you were iterating over a RichFaces' data table). – Tiny May 22 '15 at 18:21

0 Answers0