Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-552

Handle required constraint in nuxeo-data-table element

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.3.1
    • Component/s: Widgets
    • Release Notes Description:
      Hide

      Adds support for `required` on <nuxeo-data-table> as an input for multi-values proprieties.

      Show
      Adds support for `required` on <nuxeo-data-table> as an input for multi-values proprieties.
    • Tags:
    • Sprint:
      nxGang Sprint 10.1.6
    • Story Points:
      2

      Description

      USE CASES
      COMPLEX MULTIVALUED PROPERTIES

      • 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.

      IMPLEMENTATION
      Added the following properties to nuxeo-data-table:

      • label Label to display when using table in edit mode.
      • required Property that indicates if the multi value field is required or not (and shows an * indicator).
      • errorMessage Error message to display when the field is required and doesn't have any value yet.

      See attached screenshot: https://jira.nuxeo.com/secure/attachment/69228/multi-value-fields.png

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h