• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF dataTable mandatory field Validation

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using jsf dataTable inside dataTable i am having some <h:input > field
how to do a mandatory field validation inside the dataTable , i had tried with
required message but not showing the validation message.

In the below sample i need to make base fare as mandatory field.

<p:dataTable id="addBookingDataTableShow" style="width:100%;"
value="#{travelRequestBean.travelRequest.booking}" var="booking"
resizableColumns="true">

<p:column style="width:14%;">
<f:facet name="header">
<div align="left">Trip id</div>
</f:facet>
<h:inputText value="#{booking.tripId}" style="width:60%;">
</h:inputText>
</p:column>
<p:column style="width:14%;">
<f:facet name="header">
<div align="left">Base Fare</div>
</f:facet>

</p:dataTable>

Thanks in Advance

Regards,
Sriram
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You must define a place on your View where the message will be displayed.

The <h:message for="xxxid"> element acts just like an h:outputText, but will display the validation error message (if any) for the input control whose id is "xxxid". This element is useful where you want the message to display near the control that the message applies to.

The <h:messages> element will allow display of all messages formatted as a list or table.
 
sriram Ganapathi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your quick Reply Tim Holloway

Regards,
Sriram
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic