Unable to remove an IFormValidator from a Form
----------------------------------------------

                 Key: WICKET-709
                 URL: https://issues.apache.org/jira/browse/WICKET-709
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 1.3.0-beta2, 1.2.6
            Reporter: Jim Hunziker
            Priority: Minor


It seems that there is no way to remove an IFormValidator from a Form.  Because 
the fields in my Form are inside Panels (only one of which is present at any 
given time), the Form fields are not necessarily children of the Form. 

When one of the Form's IFormValidators receives a getDependentFormComponents 
call, it (correctly, I believe) returns the form components that it validates.  
An exception occurs when getParent is called on these components (in attempt to 
find the Form somewhere up the hierarchy) up the call stack. 

Since the change in the Panel that's present is made via an Ajax update, the 
same update would be able to remove the offending IFormValidator when its Panel 
is removed.  (That is, if there was a method in Form to remove an 
IFormValidator.) 

For now, I've hacked it so that my IFormValidator checks whether all its Form 
Components all have parents before any of its methods return non-null values. 

(I'm not just changing the Panel visibility because then the hidden Panels 
would still get validated, and I don't want that to happen.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to