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



Apr 4, 2013, 7:47 PM
90 Posts

Conditional validation not working on number fields?

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role:
  • Tags: Validation
  • Replies: 0
 I'm implementing "conditional" validation -- if the status of the submission isn't "Final" (i.e. it's the other status, "Draft"), then don't enforce validation.
 

 This works for text fields when the status is "Draft". However, it's triggering validations for number fields -- I'm wondering how come and what the work around is.

            <xp:inputText value="#{Report.PapersIdentified}" id="PapersIdentified" style="width:3em">
                <xp:this.converter><xp:convertNumber type="number"></xp:convertNumber></xp:this.converter>
                  <xp:this.validators>
    <xp:validateRequired message="Identified publications can't be blank"></xp:validateRequired> <!-- (1)  -->
    <xp:validateExpression message="Identified publications can't be blank"> <!-- (2) -->
      <xp:this.expression>
      <![CDATA[#{javascript:
        if (getComponent("Status").getSubmittedValue() == "Final") {
          return false;
        }
        else {
          return true;
        }
      }]]></xp:this.expression>
    </xp:validateExpression>
    </xp:this.validators>
            </xp:inputText> 

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