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



Jun 12, 2014, 4:15 PM
90 Posts

Conditional validation: make a field required only if report is being submitted as final

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 9.0.1
  • Role: Developer
  • Tags: Validation
  • Replies: 1

I want the follow validation to kick in *only* if the Report.Status field = 'Final'. (The users are allowed to submit the report as draft and come back and finish it later.)

How would I go about this?

        <xp:inputTextarea style="width:75%" value="#{Report.Agenda}" id="Agenda">
                                <xp:this.validators>
                        <xp:validateRequired
                            message="Question 1 can't be blank">
                        </xp:validateRequired><!-- (1)  -->
                    </xp:this.validators>
        </xp:inputTextarea>

Jun 13, 2014, 4:35 AM
110 Posts
Didn't the inputTextArea required checkbox can be computed?

I haven't tested but instead of ticking the "Required field" of the inputTextArea, maybe you can just compute the following SSJS into it:

Report.getValue("Status") == "Final"


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