Thanks again.
Just tried it out and it works perfect.

ContainerFeedbackMessageFilter for my form-comp-panel's feedback panel
allowed it to show it's children messages.

Using a visitor in my invalid-css-class-behavior allowed me to enable the
behavior when one of the children has an error.

This is how the isEnabled method in the invalid-css-class-behavior looks
like now:

@Override
    public boolean isEnabled(Component component)
    {
        if (component instanceof MarkupContainer)
        {
            if (component.hasErrorMessage()) return true;
            Object obj = ((MarkupContainer) component).visitChildren(new
IVisitor<Component>()
            {

                public Object component(Component component)
                {
                    if (component.hasErrorMessage())
                        return true;
                    else
                        return Component.IVisitor.CONTINUE_TRAVERSAL;
                }
            });
            return super.isEnabled(component) && (obj != null) &&
(Boolean.TRUE.equals(obj));
        }
        else
            return super.isEnabled(component) &&
component.hasErrorMessage();
    }

kind of a mess but it works great :)

Reply via email to