Hello there! I'm having problems with validators...

First, my page is not validating required fields anymore (at least not
when I set a new ValidationDelegate):

public class CustomDelegate extends ValidationDelegate {

        public void writeAttributes(IMarkupWriter writer, IRequestCycle
cycle, IFormComponent component, IValidator validator) {
                if(isInError()){
                        writer.attribute("style", 
"border:thin;border-color:#FF0000;");
                }
        }
}

<bean name="customDelegate" class="*.*.*.CustomDelegate"></bean>
        <component id="cadastroForm" type="Form">
                <binding name="delegate" value="bean:customDelegate"></binding>
        </component>

Also, I'm recording an error on my custom component using:

getForm().getDelegate().record(this,
getPage().getMessages().getMessage("error.invalid.time"));

And on my Page listener method I use:

alidationDelegate delegate = (ValidationDelegate)
getBeans().getBean("customDelegate");
                if(delegate.isInError()){
                        return null;
                }

But delegate.isInError() is returning false. All my fields are
required, and even if I don't write anything on them, I still can't
get an error.

Any ideas?

Regards

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

Reply via email to