[MGNLUI-3945] Jump to next error doesn't work with tab has 1 field Created: 12/Jul/16  Updated: 20/Apr/17  Resolved: 20/Apr/17

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.4.7
Fix Version/s: 5.5.4

Type: Bug Priority: Neutral
Reporter: Oanh Thai Hoang Assignee: Ngoc Nguyenthanh
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 0.5h
Original Estimate: 0.5h

Attachments: PNG File clicking-to-jump-to-next-error-but-nothing-happens.png     PNG File dialog-show-all.png     PNG File second-tab-error.png     PNG File third-tab-error.png    
Issue Links:
relation
is related to MGNLUI-3640 "Jump to next error" causes NullPoint... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Sprint: Saigon 91, Saigon 92
Story Points: 1

 Description   

Step to reproduce:

  • Prepare 1 dialog definition has 3 tabs that the second and the third tab has only 1 required field. dialog-show-all.png
  • Open that dialog
  • Doesn't need to input anything and click Save button

Output: Can see the correct error number but clicking to "Jump to next error" doesn't jump any where clicking-to-jump-to-next-error-but-nothing-happens.png even the second tab and the third tab has error second-tab-error.pngthird-tab-error.png

Problem: comes from FormSection.getNextProblematicField(Connector) function

    public Component getNextProblematicField(Connector currentFocused) {
        int startIndex = components.indexOf(currentFocused) + 1;
        if (startIndex < components.size() - 1) {
            while (startIndex < components.size()) {
                Component c = components.get(startIndex++);
                if (c instanceof AbstractField && !((AbstractField<?>) c).isValid()) {
                    return c;
                }
            }
        }
        return null;
    }

The if condition if (startIndex < components.size() - 1) is incorrect for the case: tab has only one field. startIndex is 0 and (components.size() - 1) is 0 also. So can't find the invalid component as expected



 Comments   
Comment by Oanh Thai Hoang [ 20/Apr/17 ]

Has been fixed by https://jira.magnolia-cms.com/browse/MGNLUI-3640

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