File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Compare two custom date input fields each having 3 inputText fields using validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Compare two custom date input fields each having 3 inputText fields using validator" Watch "Compare two custom date input fields each having 3 inputText fields using validator" New topic
Author

Compare two custom date input fields each having 3 inputText fields using validator

John Marsh
Greenhorn

Joined: Jan 07, 2012
Posts: 1
I have two input fields fromDate and toDate which are instances of Date class. The Date class uses custom Date validator which validates the month, day and year fields contained in the date field. The custom date validator is specific for each date i.e, fromDate and toDate. I need to compare the month, day or year fields of fromDate with toDate. If the fromDate is greater than toDate, a validation message has to displayed.

The fromDate and toDate are two custom date components as below

<eg:dateField id="inpFromDate" value="#{mrBean.fromDate}" .... />
<eg:dateField id="inpToDate" value="#{mrBean.toDate}" .... />
fromDate and toDate are instances of Date class which is

public class Date {
private String mm;
private String dd;
@customDateValidator //Validates each date field and implements Constraint Validator interface
private String yyyy;
//constructors
//getters and setters
How would you implement the validator in this case where each date already has a validator?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compare two custom date input fields each having 3 inputText fields using validator
 
Similar Threads
Retrieve values from a bean in JSP
Date ranges in collections
PartialTrigger with two inputDate does not work properly...
how to convert a string to date
Display cookie value in GSP (Groovy Server Pages) :