This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 4, 2011, 7:45 AM
261 Posts

Re: A simple validation that XPages is unable to handle?

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: xpages validation
  • Replies: 3
Jeroen,
 
I've solved this issue using the disableValidators property of a field. It allows you to disable the validators attached to a field, based on a (runtime) condition.
 
Sample:

<xp:this.validators>
                                    <xp:validateRequired
                                        message="This field is only required if another condition is met.">
                                    </xp:validateRequired>
</xp:this.validators>
<xp:this.disableValidators><![CDATA[#{javascript://disable validators based on some condition
if ( currentDocument.getItemValueString("fieldIsRequired") == "1") {
 return false;
} else if (getComponent("fieldIsRequiredComponentId").getValue() == "1") {
 return false;
} else {
 return true;
};
}]]></xp:this.disableValidators>
May 4, 2011, 8:02 AM
7 Posts
Re: A simple validation that XPages is unable to handle?
Thanks, this seems like a useable work-around !

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal