IzPack
  1. IzPack
  2. IZPACK-427

UserInputPanel: inputs should not be validated when panel is reloaded due to checkbox/radiobutton having revalidate="yes" in their spec

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.1
    • Fix Version/s: 4.3.4
    • Component/s: Panels
    • Labels:
      None
    • Environment:
      Generic
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      Description

      Reload of panel calls all validator added to panel. Validator are executed even on reload, which should not be the case. Validator should only be executed when "next" button is clicked.

      Following changes in izpack-src-trunk/src/lib/com/izforge/izpack/panels/UserInputPanel.java helps avoid validation in case of panel reload.
      Variable "validating" already exists in code, however its usage has been commented out . I used it in few more places

      Index: UserInputPanel.java
      ===================================================================
      — UserInputPanel.java (revision 2817)
      +++ UserInputPanel.java (working copy)
      @@ -1196,7 +1196,7 @@
      try
      {
      FileInputField panel = (FileInputField) field.getComponent();

      • result = panel.validateField();
        + result = !validating || panel.validateField();
        if (result)
        {
        idata.setVariable(field.getAssociatedVariable(), panel.getSelectedFile()
        @@ -1221,7 +1221,7 @@
        try
        {
        FileInputField input = (FileInputField) field.getComponent();
      • result = input.validateField();
        + result = !validating || input.validateField();
        if (result)
        {
        idata.setVariable(field.getAssociatedVariable(), input.getSelectedFile()
        @@ -1246,7 +1246,7 @@
        try
        {
        MultipleFileInputField input = (MultipleFileInputField) field.getComponent();
      • result = input.validateField();
        + result = !validating || input.validateField();
        if (result)
        {
        List<String> files = input.getSelectedFiles();
        @@ -1834,7 +1834,7 @@

      // validate the input
      Debug.trace("Validating text field");

      • boolean success = textField.validateContents();
        + boolean success = !validating || textField.validateContents();
        if (!success) { Debug.trace("Validation did not pass, message: " + message); @@ -3909,7 +3909,11 @@ // readInput(); // panelActivate(); // validating = true; + Debug.trace("Setting validating to false"); + validating=false; updateDialog(); + Debug.trace("Setting validating back to true"); + validating=true; }

        Issue Links

          Activity

          Hide
          Julien Ponge added a comment -

          Formatting broke your patch. Could you please upload it as an attachment?

          Show
          Julien Ponge added a comment - Formatting broke your patch. Could you please upload it as an attachment?
          Hide
          Sergiy Shyrkov added a comment -

          I guess, the pasted patch is the same Kshitiz has posted in the mailing list: http://markmail.org/message/jbupthhx3zopfvrw

          We are also interested in that patch.
          Thank you in advance!

          Kind regards
          Sergiy

          Show
          Sergiy Shyrkov added a comment - I guess, the pasted patch is the same Kshitiz has posted in the mailing list: http://markmail.org/message/jbupthhx3zopfvrw We are also interested in that patch. Thank you in advance! Kind regards Sergiy
          Hide
          Julien Ponge added a comment -

          Even so, I would prefer a fresh patch. The one is the mailing-list does not apply on the master branch.

          Thanks

          Show
          Julien Ponge added a comment - Even so, I would prefer a fresh patch. The one is the mailing-list does not apply on the master branch. Thanks
          Hide
          Sergiy Shyrkov added a comment -

          By the way, this one is a duplicate of IZPACK-603

          Julien, you've posted a comment in that ticket that no further releases are planned for 4.3 code branch.
          Could you please confirm that 4.3.3 was the last release on that branch?
          I guess, you can close this ticket as "Won't fix". A new ticket should be opened for the 5.x code base if the issue is still present.

          Thank you in advance!

          Kind regards
          Sergiy

          Show
          Sergiy Shyrkov added a comment - By the way, this one is a duplicate of IZPACK-603 Julien, you've posted a comment in that ticket that no further releases are planned for 4.3 code branch. Could you please confirm that 4.3.3 was the last release on that branch? I guess, you can close this ticket as "Won't fix". A new ticket should be opened for the 5.x code base if the issue is still present. Thank you in advance! Kind regards Sergiy
          Hide
          Julien Ponge added a comment -

          We are releasing a 4.3.4 this week thanks to the work of a contributor called Mark Miller.

          I am going to include that patch from IZPACK-603

          Show
          Julien Ponge added a comment - We are releasing a 4.3.4 this week thanks to the work of a contributor called Mark Miller. I am going to include that patch from IZPACK-603

            People

            • Assignee:
              Julien Ponge
              Reporter:
              Kshitiz Saxena
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: