Nov 4, 2015, 5:34 AM
24 Posts

Xpages-Overrule Combobox Validation

  • Category: Dojo and Client Side JavaScript
  • Platform: All
  • Release: All
  • Role:
  • Tags:
  • Replies: 1

Hi

 

I am new in Xpages Development, Some how manage to learn some stuff from net,

My Requirement

I am having an existing application, where I am having a mandatory field, now the requirement is I need a draft version, which means If the user has checked on a check box the validation should be overruled

I am able to bind the field with for which is as following

<xp:tr>

<xp:td><xp:label value="Draft:" id="draft_label" style="font-weight:bold">

</xp:label>(Check if the version is draft)</xp:td>

<xp:td>

<xp:checkBox text="Draft" id="checkBox"

value="#{dominoDoc.iDraft}" checkedValue="1" uncheckedValue="0">

 

</xp:checkBox></xp:td>

<xp:td></xp:td>

<xp:td></xp:td>

</xp:tr>

I am having a combo box, where the validators are written

<xp:td themeId="SMS.form.td.content">

<xp:comboBox id="comboBoxRe"

style="width:97.0%;font-size:10pt" value="#{dominoDoc.Res}"

disableClientSideValidation="true">

 

 

<xp:this.validators>

<xp:validateRequired

message="Please provide a name">

</xp:validateRequired>

</xp:this.validators>

 

I want to skip this validation if the user has checked on Draft, I managed to get some stuff, but exactly where I have to use I am confused

 

 

 

 

 

 

 

 

Nov 4, 2015, 9:35 AM
298 Posts
use the loaded property
The Validators have a loaded property to determine if they get loaded when the page loads. That should work as long as you understand that if you change the status from draft to whatever the page has to be loaded again to get the validators to work.

Otherwise, write your own validator using the validateExpression one.

Howard