message for a component iside dataTable

Hello!

I have another issue. I am using a dataTable for dynamic form. The problem is that when user enters an invalid value I have no means of displaying which field is invalid because I do not know how to assign an id to components that are within the dataTable.

I would like to do something similar to:

<h:dataTable id="attrs" value="#{bean.attributes}" var="attr">

<h:inputText id="attr#{attr.id}" value="#{attr.value}" converter="javax.faces.Double" />

<h:message for="attr#{attr.id}" showDetail="false" showSummary="true"/>

</h:dataTable>

The code snippet above does not function of course but I would like to know if there is a way to achieve something like that.

[969 byte] By [infiniteLoopa] at [2007-11-26 15:29:00]
# 1
You can and may not use EL in ID's, remove EL and use static text in ID's.
BalusCa at 2007-7-8 21:45:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi Balus! It is you again :)Yes I am aware of that, but if I hard-code the id i get the duplicate component id error. The problem is that dataTable draws as many input fields as there are attributes in the collection.
infiniteLoopa at 2007-7-8 21:45:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

<h:dataTable value="#{myBean.list}" var="item">

<h:column>

<h:inputText id="value" value="#{item.value}" />

<h:message for="value" />

</h:column>

</h:dataTable>

Such a construction just works here. Try upgrading to a newer JSF version. I've tested it at 1.1_02 by the way. Check http://javaserverfaces.dev.java.net to download JSF.

BalusCa at 2007-7-8 21:45:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...