File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes JSF Validation in dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF Validation in dataTable" Watch "JSF Validation in dataTable" New topic

JSF Validation in dataTable

deepa durai

Joined: May 08, 2007
Posts: 18
I want to validate the fields in the dataTable and the custom error message needs to be displayed on the top not beside the field.
I am able to display the error message beside the field.(<h:message for="email" style="color:red"/>).
But the error message is not displayed outside the dataTable.Can anyone help me please
viswanath yadav

Joined: May 25, 2009
Posts: 15

keep the message tag seperately in panelGrid above the DataTable and declare the message tag as Globally like the code shown below,

<h:panelGrid id="panel1" columns="1" width="100%">
<h:messages id="message_queryDesign" globalOnly="true" layout="table" showDetail="true" errorClass="ERROR" infoClass="INFO" />

then it will work fine.

Thanks ,

A.Viswanath Yadav
I agree. Here's the link:
subject: JSF Validation in dataTable
It's not a secret anymore!