• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validation of inputText in rich:dataTable

 
srikanth Thandra
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How to provide validation for inputText component in rich:dataTable?

Suppose that sessionScope listVlaues has two objetcs. So dataTable contains two outputTexts and two InputTexts. Now my requirement is, I have to show a validation message "Enter only Number" for inputText under below of inputText.

How can i achieve this? kindly post the reply as soon as possible
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18226
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've miscoded your inputText. It would be more like:


I don't remember the exact name or format of the regex pattern validator, however, so this is just a guideline. Also, as written the error message will be to the right of the text control unless you have text wrapping in that column. Solutions include the brute-force approach of adding a raw HTML <br/> tag to force a new line (not recommended) or wrapping the input control and message in a dataGrid component that's 1 column wide.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic