[MGNLUI-3527] Item count validation for multi field Created: 18/Aug/15  Updated: 20/Jul/21  Resolved: 13/Jul/21

Status: Closed
Project: Magnolia UI
Component/s: forms
Affects Version/s: 6.2
Fix Version/s: 6.2.11

Type: New Feature Priority: Neutral
Reporter: Stefan Jahn Assignee: Martin Haderka
Resolution: Fixed Votes: 7
Labels: multifield, ux, validation
Remaining Estimate: Not Specified
Time Spent: 0.95h
Original Estimate: Not Specified

Attachments: Java Source File SortableMultiValueField.java     Java Source File SortableMultiValueFieldDefinition.java     Java Source File SortableMultiValueFieldFactory.java     PNG File image-2021-06-14-11-05-49-092.png     File styles.css    
Issue Links:
Cloners
clones MGNLUI-3381 Reorderable MultiValueField Closed
Problem/Incident
Relates
relates to MGNLUI-6549 Consolidate M6 MultiFormView Closed
causality
is causing MGNLUI-6796 Improve item count validation error f... Closed
dependency
depends upon MGNLUI-6607 MultiFields can't be set as required Closed
depends upon MGNLUI-3313 Improve validation capabilities of th... Closed
duplicate
duplicates MGNLUI-6607 MultiFields can't be set as required Closed
Template:
Acceptance criteria:
Empty
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: formLevelValidation
Sprint: UI FW 32
Story Points: 3

 Description   

Check for support of min/max number of entries in MultiValueFields. Two aspects:

  • Validation (thus depends upon MGNLUI-3313)
  • UI: ideally this would also be reflected on availability of the add/remove buttons.

Quoting the relevant parts from the cloned ticket:

Furthermore you are not able to limit the number of entries.
[...]
The attached SortableMultiField [has a new maxComponents property] into the definition so you can [...] limit the number of entries in the MultiField.



 Comments   
Comment by Mikaël Geljić [ 18/Aug/15 ]

Splitting the min/max entry vs. reordering concerns into a separate ticket.

Comment by René Schubert [ 04/Aug/17 ]

Fix Version is set to 5.3.x, but this still seems to be an issue and is not yet closed. Also, it seems that marking a MultiValueField as required makes the required error message appear permanently. I'd expect it to only appear, if the list does not have at least one entry.

Can you please reconsider this issue? Are there any known workarounds, other than not marking the field as required?

Comment by Marty Glaubitz [ 01/Oct/18 ]

Still a problem in 5.7

Comment by Mikaël Geljić [ 08/Oct/18 ]

Hi martyglaubitz, rschubert,

I've been looking into this a while ago, and have now put up a gist doing just that (Validator impl & YAML definition).
You might be able to use it or draw inspiration from it.
https://gist.github.com/mkgl/9b9acdc1070705aacb3a8411e22bd9dd

Note this is based on Magnolia 5.6+, but the only difference with prior versions is the Vaadin v7 packages.

Hope this helps,
Mika

Comment by Šimon Demočko [ 08/Feb/21 ]

Should we turn this into a 6.2.x improvement? Otherwise I'd close it.

Comment by Christopher Chard [ 14/Jun/21 ]

 ,

this would still be a welcome improvement!

We have several cases for this. Using a description-Info "Please only add a max. of four entries" for editors is not really nice...

Cheers,
Chris

Comment by Marcin Karpeta [ 08/Jul/21 ]

+1
Currently it's big disadvantage you cannot limit number of replicants (multivaluefields) in ANY way...

Generated at Mon Feb 12 09:07:30 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.