dataTable error messages incorrect
----------------------------------

         Key: MYFACES-735
         URL: http://issues.apache.org/jira/browse/MYFACES-735
     Project: MyFaces
        Type: Bug
  Components: Tomahawk  
    Versions: 1.1.0, 1.1.1    
 Environment: Windows XP SP2, JBoss 4.0.2, Java 1.5.0_04
    Reporter: Frode Oldervoll


Validation messages does not work properly for fields inside a data table. 
Assigning an id to fields inside a dataTable should work; they still are unique 
per row since the dataTable index is included in the actual id. The error 
messages still does not seem to work, however.

 Here is an example. I have this form with a dataTable inside, which again 
contains a set of outputLabel/inputText pairs.

<h:form id="testForm">
      <t:messages/>
      <t:dataTable id="testTable">
            <h:column>
                  <h:outputLabel for="testField" value="Test label"/>
                  <h:inputText required="true" id="testField"/>
            </h:column>
      </t:dataTable>
</h:form>

The actual HTML code generated for a couple of rows looks like this:

<label for="testForm:testTable_0:testField">Test label</label>
<input id=" testForm:testTable_0:testField" name=" 
testForm:testTable_0:testField" type="text" value=""/>

<label for="testForm:testTable_1:testField">Test label</label>
<input id=" testForm:testTable_1:testField" name=" 
testForm:testTable_1:testField" type="text" value=""/>
 
Even if the ids in the label and the input field matches I still get the 
message "Validation Error in testField" instead of "Validation error in Test 
label".

This behaviour is not usable in a production environment, and therefore we are 
enforced to create our own validators where we have full control over the error 
messages.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to