Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SelectOneMenu Validation  RSS feed

 
Mal Tec
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i need to validate the selectoneMenu in JSF. I'm using



using properties for error msg:


i get UIInput.REQUIRED's error: Please enter a value for this field on selecting option Select with value null.. I want to get special error for UISelect like...

or need to fire it thorugh Invalid

How it can be done? Or if any tother alternative available.
 
suresh dasari
Ranch Hand
Posts: 121
Chrome Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1) if you are allowed to use tomhawk library then correct your code as follows



if you want you can pull the summary message from property file and change as you like

2) write a custom validator and divert the flow to your custom validator and write the logic in java class.

3) you can write a listener and write the appropriate logic before validation phase.


 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!