1
votes

I am using some Dojo Filtering Select controls on my XPage. Despite having set the required property to false, when I attempt to save the XPage document, I see the message "This value is required" in the Dojo Filtering Select control. I would like to know

1/ is it possible to make a Dojo Filtering Select control NOT obligatory?

2/ Is it possible to customize the error message which appears when the control is obligatory?

2
I'm now trying to get client side validation working with a Dojo Filtering Select, however it just does not work :-( I have added my code to the question above.user1358852
The original question was answered. Your Update question is different from your first question. Why don't you create a new question?Knut Herrmann
Ok, I will do that. - Just created the new question now.user1358852

2 Answers

3
votes

1) You get the message "This value is required" at client side validation. So, in addition to property required="false" which is responsible for server side validation only you have to set a dojoAttribute "required" to "false". Then you don't get the message anymore.

<xe:djFilteringSelect
    id="djFilteringSelect1"
    value="#{...}"
    required="false">
    <xe:this.dojoAttributes>
        <xp:dojoAttribute
            name="required"
            value="false">
        </xp:dojoAttribute>
    </xe:this.dojoAttributes>
</xe:djFilteringSelect>

2) The same way you can set the dojoAttribute "missingMessage" to the string you like in case your control stays obligatory.

2
votes

you can customized these parameters (They are in the parent ValidationTextBox of FilteringSelect):

// required: Boolean
//      User is required to enter data into this field.
required: false,

// promptMessage: String
//      If defined, display this hint string immediately on focus to the textbox, if empty.
//      Also displays if the textbox value is Incomplete (not yet valid but will be with additional input).
//      Think of this like a tooltip that tells the user what to do, not an error message
//      that tells the user what they've done wrong.
//
//      Message disappears when user starts typing.
promptMessage: "",

// invalidMessage: String
//      The message to display if value is invalid.
//      The translated string value is read from the message file by default.
//      Set to "" to use the promptMessage instead.
invalidMessage: "$_unset_$",

// missingMessage: String
//      The message to display if value is empty and the field is required.
//      The translated string value is read from the message file by default.
//      Set to "" to use the invalidMessage instead.
missingMessage: "$_unset_$",

// message: String
//      Currently error/prompt message.
//      When using the default tooltip implementation, this will only be
//      displayed when the field is focused.
message: "",

If you set required to false, it should not prompt message, can you post you code.