Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-3945

Jump to next error doesn't work with tab has 1 field

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Neutral
    • 5.5.4
    • 5.4.7
    • None
    • None
    • Saigon 91, Saigon 92
    • 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

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                ngoc.nguyenthanh Ngoc Nguyenthanh
                oanh.thai Oanh Thai Hoang
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - 0.5h
                      0.5h
                      Remaining:
                      Remaining Estimate - 0d
                      0d
                      Logged:
                      Time Spent - 0.5h
                      0.5h