Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9217001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:32:32+00:00 2026-06-18T02:32:32+00:00

Ultimately I need to do some cross field validation and thought I would use

  • 0

Ultimately I need to do some cross field validation and thought I would use a custom validator to do this. But I can’t even get a simple example to work. The following code (which is pretty similar to that on p.116 of “Mastering XPages” allows any value (including an empty field). Am I missing something obvious?

            <xp:inputText
                id="field1"
                value="#{document1.field1}">
                <xp:this.validators>
                    <xp:customValidator>
                        <xp:this.validate><![CDATA[#{javascript:if (value == "") {
return new javax.faces.application.FacesMessage("Please enter a value");
}}]]></xp:this.validate>
                    </xp:customValidator>
                </xp:this.validators>
            </xp:inputText>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:32:33+00:00Added an answer on June 18, 2026 at 2:32 am

    It is not possible to validate an empty field with a validator. A validator runs only if a value exist. In XPages you have the required property for fields which allows to check for empty fields; this is a workaround for this problem, and it is (as far as I know) not possible to create your own “required” validator.

    If you want to create your own one, you have to create a converter instead

    UPDATE 21.06.2013

    It is possible to create an own required validator with a small workaround: http://hasselba.ch/blog/?p=764

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know it sounds weird but I need it for a workaround. So some
I have a file that looks like this (but is much bigger): >some text
Apologies if this is really stupid, but I just can't figure out how to
I need to add some jars from JRE7 library to my Android project. But
I have a suse box that holds three Catalyst apps. Ultimately I need to
I need to get the system locale to do a number of things, ultimately
Ultimately I am trying to run some code which depends on the value (or
Background Information: Ultimately, I would like to write an emulator of a real machine
So what I am trying to do ultimately is read a line, do some
I can get a json from some services in Angular function, however, there are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.