I am having trouble figuring out how to add a custom validation rule to
a form. This is my form bean in the pageflow:
@SuppressWarnings("serial")
@Jpf.FormBean
public static class MyFormBean implements Serializable {
private String to;
private String from;
public MyFormBean() {
}
@Jpf.ValidatableProperty(displayName = "To Date",
validateRequired = @Jpf.ValidateRequired(), validateDate =
@Jpf.ValidateDate(pattern = "MM/dd/yyyy"))
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
@Jpf.ValidatableProperty(displayName = "From Date",
validateRequired = @Jpf.ValidateRequired(), validateDate =
@Jpf.ValidateDate(pattern = "MM/dd/yyyy"))
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
}
It is successfully checking that the dates are passed in and in the
correct format, but now I want to make sure that the "from date" is
before the "to date". What is the most correct way to do this? Should
I use the "Jpf.ValidateCustomRule
<http://beehive.apache.org/docs/1.0/apidocs/classref_netui/org/apache/be
ehive/netui/pageflow/annotations/Jpf.ValidateCustomRule.html> "
annotation, and if so, on which property (seen as how this validation
rule involves two properties)?
Ben
**************************************************************
This message, including any attachments, contains confidential information
intended for a specific individual and purpose, and is protected by law. If
you are not the intended recipient, please contact sender immediately by reply
e-mail and destroy all copies. You are hereby notified that any disclosure,
copying, or distribution of this message, or the taking of any action based on
it, is strictly prohibited.
TIAA-CREF
**************************************************************