title: Compare two fields that use same class
body: <p>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.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>The fromDate and toDate are two custom date components as below</p>
  
  <pre><code>&lt;eg:dateField id="inpFromDate" value="#{mrBean.fromDate}" .... /&gt;
  &lt;eg:dateField id="inpToDate" value="#{mrBean.toDate}" .... /&gt;
  </code></pre>
  
  <p>fromDate and toDate are instances of Date class which is</p>
  
  <pre><code>public class Date {
  private String mm;
  private String dd;
  @customDateValidator   //Validates each date field
  private String yyyy;
  //constructors
  //getters and setters
  </code></pre>
  
  <p>How would you implement the validator in this case where each date already has a validator</p>