Hello,
I am trying to do a simple check on a paragraphField or any field(integer, text, decimal field).
The validation is not working for empty or null. I tried giving a!isNullOrEmpty(ri!value), Null(ri!value), ri!value=null. The validation message is not shown.
If i give any other logic, it works.
Discussion posts and replies are publicly visible
A field based validation is only evaluated when the value is not null. Set "required" to true to catch this.
Hi Stefan,
i dont want the asterix.
Why? It is a good UI design style to indicate to the user that a field is required.
But, feel free to add a form based validation, or wrap the text field into a section layout and add your validation to it.
If i use section layout validation, the validation is seen at load itself. i want it to get validated on click of button. What is a form based validation?
The form layout also supports validations.
Its same like getting the validation on load before user can input anything. I was hoping we could not show the asterix.
Have to use it i suppose.
Using a!validationMessage function will help to achieve this.
a!formLayout( label: "New Application", contents: { a!paragraphField( label: "Paragraph", labelPosition: "ABOVE", value: ri!text, saveInto: { ri!text }, refreshAfter: "UNFOCUS", height: "MEDIUM", validations: {} ) }, validations: a!validationMessage( message: "Invalid", showWhen: a!isNullOrEmpty(ri!text), validateAfter: "SUBMIT" ), buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", submit: true(), style: "PRIMARY" ) } ) )
Perfect. Thanks you Jones .