aspose file tools*
The moose likes JSF and the fly likes Validation question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Validation question" Watch "Validation question" New topic
Author

Validation question

seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
I need to validate a form so that it's valid if the user entered something into at least one field out of two. Is there a standard way to do this with validators in JSF, or should I just take care of this in the backing bean?

Seb
Aditya Tallapally
Greenhorn

Joined: Aug 28, 2005
Posts: 10
You could use javascript or backing beans as you said.
I prefer doing it using javascript, add implementation to form button.

Guys correct me if i am wrong.
seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
Originally posted by Aditya Tallapally:
You could use javascript or backing beans as you said.
I prefer doing it using javascript, add implementation to form button.

Guys correct me if i am wrong.


Ok. I would think I prefer the backing bean solution since it eliminates the possibility of the user disabling the javascript restriction and posting the illegal form content anyway.

Thanks.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
I would go for both. Javascript for user's convenience, server-side for reliablity.

Cheers.
seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
Originally posted by Adeel Ansari:
I would go for both. Javascript for user's convenience, server-side for reliablity.

Cheers.


agree
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validation question