I do not have an easy solution to your problem.
The following is just an idea which I have not tested.

Have you considered 'extending' the component
TextField
to hava an extra  boolean parameter 'validation flag'
?
The idea is that validation is skipped according to
the 
 'validation flag'. In your case, the value of this
'validation flag' would
come from the checkbox.

In TextField.java, during rewind, validation is done
in:
  protected void rewindFormComponent(IMarkupWriter
writer, IRequestCycle cycle)
    {
        String value = cycle.getParameter(getName());

        try
        {
            Object object =
getTranslatedFieldSupport().parse(this, value);

           
getValidatableFieldSupport().validate(this, writer,
cycle, object);

            setValue(object);
        }
        catch (ValidatorException e)
        {
            getForm().getDelegate().record(e);
        }
    }

============
You could try to modify the above to skip  the line

  getValidatableFieldSupport().validate(this, writer,
cycle, object);

according the  value of 'validation flag'.

Shing 




--- bëgantis debesis <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> to simplify a problem, let's say i have a @Checkbox
> and many @Text
> components in a form.
> I want no validation when the checkbox is checked,
> and validation must be
> executed, when form is submitted with the checkbox
> not checked. @Text
> component contents must be validated.
> Do you know any ways of doing this?
> 
> Thanks in advance,
> Valdemaras Repšys
> 


Home page :
  http://uk.geocities.com/matmsh/index.html


                
___________________________________________________________ 
All New Yahoo! Mail – Tired of [EMAIL PROTECTED]@! come-ons? Let our SpamGuard 
protect you. http://uk.docs.yahoo.com/nowyoucan.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to