Here is my datePicker control where expression validation works fine:
<xp:inputText id="inputComboUntil">
<xp:this.converter><xp:convertDateTime pattern="MMM d, yyyy"></xp:convertDateTime></xp:this.converter>
<xp:this.validators>
<xp:validateExpression>
<xp:this.expression><![CDATA[#{javascript:var var1 = getComponent("inputDate").getValue();
if(var1!=null){
var var1D:NotesDateTime = session.createDateTime(var1);
var var2D:NotesDateTime = session.createDateTime("Today");
var2D.setNow();
if(var1D.timeDifference(var2D) < 0){
return false;
} else {
return true;
}
} else {
return true;
}}]]>
</xp:this.expression>
<xp:this.message><![CDATA[You cannot set date in the past]]></xp:this.message>
</xp:validateExpression>
</xp:this.validators>
<xp:dateTimeHelper id="dateTimeHelper3"></xp:dateTimeHelper>
</xp:inputText>
But if I pick another correct date it seems the validation works with the old one so then fails with validation error. I have nothing in onChange event. Assume picking new date should refresh validation. Note: I have this problem on Domino 8.5.3