Hi Martin,
thanks so much for the replies... almost done, some little questions still
there.. I got it working, could you verify that its right what I made? :)

1)
*//Had Error: Wrong number of type arguments, required 2 - It works when I
do  IVisitor<Component,Void> ;-) 
public class ShinyFormVisitor implements IVisitor<Component>,Serializable {*

    Set visited = new HashSet();

    public void component(final Component c, final IVisit<Void> visit
/*[2]*/) {
        if (!visited.contains(c)) {
            visited.add(c);
            c.add(new RequiredBorder());
            c.add(new ValidationMsgBehavior());
            c.add(new ErrorHighlightBehavior());
        }
    }

...

    private class ValidationMsgBehavior extends Behavior {

        public void onRendered(Component c) {
            FormComponent fc = (FormComponent) c;
            if (!fc.isValid()) {
                String error;
                if (fc.hasFeedbackMessage()) {
                  * //Had error, now working with this.. thats right?
                    error =
fc.getFeedbackMessages().first().getLevelAsString();*
                   
                } else {
                    error = "Your input is invalid.";
                }
                fc.getResponse().write(
                        "<div class=\"validationMsg\">" + error + "</div>");
            }
        }
    }
}


2) Do you know any good wicket tutorials/example where I can learn how to
work with customized FeedbackMessages?

thanks..




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/highlight-invalid-fields-with-custom-Validation-Framework-tp4652949p4653024.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to