cancel
Showing results for 
Search instead for 
Did you mean: 

How to validate a numeric range float field in Nuxeo Studio on a form layout?

Matthew_Roy
Champ on-the-rise
Champ on-the-rise

Using purely Nuxeo Studio, how do you go about validating a numeric range for a float field in a form layout?

Currently, I have the validation set in the schema field properties that this float can only be values in the inclusive-range: [0.1, 9.9].

However, when the user goes to submit this form, they can still post the request but the form is not saved (as expected) & a 'Transaction Failed' notification is displayed in the upper-right corner of the screen.

How do I set this validation to occur in the form layout?

For example, if you set a field to be required in a form layout, it will not let the user submit the form and will show a 'Value is required' error message in the layout. How do I achieve this for a numeric range?

1 ACCEPTED ANSWER

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Hello,

If you set your integer property as required with a numeric range, then Studio Designer will automatically generate the suitable UI element. For example, this is what it typically generates:

<nuxeo-input role="widget" value="{{document.properties.myschema:test}}" label="Test" type="number" min="3" max="7" required="true"></nuxeo-input>

So, you can still play with the attributes of our elements anyway.

View answer in original post

1 REPLY 1

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Hello,

If you set your integer property as required with a numeric range, then Studio Designer will automatically generate the suitable UI element. For example, this is what it typically generates:

<nuxeo-input role="widget" value="{{document.properties.myschema:test}}" label="Test" type="number" min="3" max="7" required="true"></nuxeo-input>

So, you can still play with the attributes of our elements anyway.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.