Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes Input Text in Data Tables and Validation Errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Input Text in Data Tables and Validation Errors" Watch "Input Text in Data Tables and Validation Errors" New topic
Author

Input Text in Data Tables and Validation Errors

Martin Dubuc
Greenhorn

Joined: Feb 10, 2006
Posts: 8
I have a page with two components. The first component is an HTML input text component that requires a value (h:inputText with required="true"). The second component is an HTML data table (h:dataTable) that contains a column with an input text field (the latter required property is set to false).

If the end-user fills in a number of rows in the data table, but does not fill in the input text field that is not part of the table, when the page is submitted, in the validation phase, the input text field which requires some value will cause validation to fail. The application will stay on the current page (possibly printing out some error messages if the appropriate JSF tags have been specified). This is expected. But I don't expect all text entered in the data table to disappear when the page is re-rendered which is what is happening right now. Is there a way to prevent this from happening? I'd hate to force the user to re-enter all of the tables data.

Other input text field that are not part of a table are not cleared when a validation error occurs. The case of input field within data table seems to be an exception to this rule.

I had the impression that this problem would get fixed in JSF 1.2, but I still see the same behavior in the latest 1.2 RI (1.2_03).

Martin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Input Text in Data Tables and Validation Errors