[izpack-changes] r1786 - izpack-src/trunk/src/lib/com/izforge/izpack/panels

noreply at berlios.de noreply at berlios.de
Wed Mar 14 16:55:06 CET 2007


Author: vralev
Date: 2007-03-14 16:55:03 +0100 (Wed, 14 Mar 2007)
New Revision: 1786

Modified:
   izpack-src/trunk/src/lib/com/izforge/izpack/panels/UserInputPanel.java
Log:
Ignore password and rule validation errors on dynamic revalidation (this kind of validation will occur only on "Next")

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/panels/UserInputPanel.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/panels/UserInputPanel.java	2007-03-14 15:44:15 UTC (rev 1785)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/panels/UserInputPanel.java	2007-03-14 15:55:03 UTC (rev 1786)
@@ -370,6 +370,10 @@
     private Vector entries = new Vector();
 
     private LocaleDatabase langpack = null;
+    
+    // Used for dynamic controls to skip content validation unless the user
+    // really clicks "Next"
+    private boolean validating = true;
 
     /*--------------------------------------------------------------------------*/
     // This method can be used to search for layout problems. If this class is
@@ -1396,7 +1400,7 @@
         }
         if ((variable == null) || (ruleField == null)) { return (true); }
 
-        boolean success = ruleField.validateContents();
+        boolean success = validating ? ruleField.validateContents() : true;
         if (!success)
         {
             String message = "";
@@ -2029,7 +2033,7 @@
         if ((variable == null) || (passwordGroupsRead.contains(group))) { return (true); }
         passwordGroups.add(group);
 
-        boolean success = group.validateContents();
+        boolean success = validating ? group.validateContents() : true;
 
         if (!success)
         {
@@ -3392,8 +3396,10 @@
     
     // Repaint all controls and validate them agains the current variables
     public void actionPerformed(ActionEvent e) {
+       validating = false;
        readInput();
        panelActivate();
+       validating = true;
    }
 
 } // public class UserInputPanel




More information about the izpack-changes mailing list