USE CASE
- In JSF UI, a list widget is used for multivalued / complex multivalued fields
- The list widget can be marked as required in the UI so that you are forced to enter at least one value
- In Web UI, this translates to a `nuxeo-data-table` element
- For JSF => Web UI migration, we want to move constraints expressed in the UI to the schemas so that we can scaffold proper layouts in Designer afterwards
- So we would add a required constraint on the property and use a `nuxeo-data-table` element for the layout
- But it would be akward for users to have a required constraint set at schema level if they do not see a red `*` on the field in web ui => `nuxeo-data-table` element should handle this
EXAMPLE USAGE
complex field address (required)
- street name and number (required)
- state (optional)
- ...
in the example above,
- I want my user to have to fill in an address, so I make the address field required,
- then in the address some parts only are required so only some of the sub fields are required.
Currently we handle the second part only.
TODO
TP 10.1+
Given that ELEMENTS-552 is done
- Allow multivalued complex fields in Studio schemas to have the required constraint (schemas, workflow and node variables, automation parameters if they support this type of field when this ticket is taken care of)
- Only applies to multivalued complex fields, not single valued ones
ACCEPTANCE CRITERIA
- When adding a complex multivalued field to a schema, I can edit this field and add the required constraint on it
- When adding the required constraint, the generated XML contains this constraint
- If I remove the multivalued option on the complex field, the required constraint is not available anymore in the UI
- If I remove the multivalued option on the complex field, the required constraint is not added to the generated XML
- depends on
-
ELEMENTS-552 Handle required constraint in nuxeo-data-table element
- Resolved
-
NXS-4507 Investigate why complex fields cannot be set as required
- Resolved
- is required by
-
NXS-4540 Handle required constraint in Designer for nuxeo-data-table element
- Open