Hi,

I have form with few TextField and DropDownChoice components. All of them have 
added AjaxFormComponentUpdatingBehavior( "onkeyup" ) and are set as required. 
Some of them are wrapped in my custom objects, but it does not matter 
(validation and processing logic is in behavior).

With this setup after every ajax update triggered with behaviour's onUpdate( 
AjaxRequestTarget ) or onError( AjaxRequestTarget ) I try to check if form 
components are valid and give instant feedback to user.

Unfortunately results obtained from component's isValid() are wrong. Empty 
TextFields are almost always valid.
Only after clearing TextField error is added to component, but after changing 
for example other TextField to whatever value (and thus triggering next 
validation check) isValid() on blank, required TextField returns true.

Is this approach incorrect or am I missing something?

Best regards,
Michal Wegrzyn


Reply via email to