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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Neutral
    • Resolution: Obsolete
    • Affects Version/s: 5.4.7
    • Fix Version/s: 5.5.4
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Saigon 91, Saigon 92
    • Story Points:
      1
    • Magnolia Release:
      5.5.4

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

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