Alright, I have something like this now: Problems/Errors are *bold*
//Here is a problem with the class: it says: ShinyFormVisitor is not
abstract and does not override abstract method component(Object,IVisit) in
public class *ShinyFormVisitor* implements IVisitor, Serializable {

    Set visited = new HashSet();

*//Is that ok now? with IVisitor for wicket 6.0?*
    public void component(final Component c, final IVisit<Void> visit) {
        if (!visited.contains(c)) {
            c.add(new RequiredBorder());
            c.add(new ValidationMsgBehavior());
            c.add(new ErrorHighlightBehavior());

    private class RequiredBorder extends BorderBehavior {

        public void renderAfter(Component component) {
            FormComponent fc = (FormComponent) component;
            if (fc.isRequired()) {

    private class ValidationMsgBehavior extends Behavior {

        public void onRendered(Component c) {
            FormComponent fc = (FormComponent) c;
            if (!fc.isValid()) {
                String error;
                if (fc.hasFeedbackMessage()) {
*//getFeedbackMessage() could not be found*
                    error =
                } else {
                    error = "Your input is invalid.";
                        "<div class=\"validationMsg\">" + error + "</div>");

    private class ErrorHighlightBehavior extends Behavior {

        public void onComponentTag(Component c, ComponentTag tag) {
            FormComponent fc = (FormComponent) c;
            if (!fc.isValid()) {
                tag.put("class", "error");

View this message in context:
Sent from the Users forum mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to