Although the or tag has a //for// attribute to specify an Id to display messages of, one can not specify e.g. an Id of a table to display validation messages of elements inside that table, because the table itself does not generate the messages. As a work around I used a custom Validator. In my case I wanted to display validation messages for input fields which elements has to be ‘>= 0’:

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;

public class TestValidator implements Validator {
    @Override
    public void validate(FacesContext arg0, UIComponent arg1, Object arg2) {// throws ValidatorException {
        int myVal = (Integer)arg2;
        Object ret = arg1.getAttributes().get("target");

        if(myVal < 0) {
            FacesMessage myMsg = new FacesMessage();
            myMsg.setSeverity(FacesMessage.SEVERITY_WARN);
            myMsg.setDetail("Detail comin' here");
            myMsg.setSummary("Summary goes here");
            if(ret != null && ret instanceof String) {
                String target = (String)ret;
                javax.faces.context.FacesContext.getCurrentInstance().addMessage(target, myMsg);
            }
        }
    }
}

As you might have seen, I also passed the value of the <[rich h]:message[s]> tag’s for attribute (used as Object ret and String target in the code above). To complete the configuation of the custom validator we need to decalre it in the faces-config.xml:

...
<validator>
   <validator-id>test.TestValidator</validator-id>
      <validator-class>my.package.TestValidator</validator-class>
   </validator>
...

The usage of this validator is shown in the following example:

...
<h:outputText value="Table1"/>
    <rich:messages for="testForm:myMsgField"/>      
    <rich:dataTable id="tab1" value="#{remoteTestClass.tableOne}"....>
....
<h:inputText id="myMsgField" value="#{remoteTestClass.testField}">
    <a4j:support event="onchange" ajaxSingle="true" action="#{remoteTestClass.test2()}"/>
    <f:validator validatorId="test.TestValidator"/>
    <f:attribute name="target" value="testForm:myMsgField"/>
</h:inputText>
...

AFAIK, it is not possible to pass the an argument as part of the ** tag, so I passed it as part of the parent ** tag. What is more, the usage of the message tag with the for atrtibute needs a corresponding input field to work as expected, meaning to display faked of that field. 'Faked' because we don't use exactly this input field but the input field inside the table:

...
<h:inputText id="myMsgField" rendered="false"/>
...