FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



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
300 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

FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.