package pl.tomaszdziurko.jvm_bloggers.view.panels;

import org.apache.wicket.feedback.FeedbackMessage;
import org.apache.wicket.feedback.IFeedbackMessageFilter;
import org.apache.wicket.markup.html.panel.FeedbackPanel;

public class CustomFeedbackPanel extends FeedbackPanel {

    final static String COMMON_FEEDBACK_CSS_CLASS = "feedbackPanelItem";

    public CustomFeedbackPanel(String id) {
        super(id);
    }

    public CustomFeedbackPanel(String id, IFeedbackMessageFilter filter) {
        super(id, filter);
    }


    @Override
    protected String getCSSClass(FeedbackMessage message) {
        return COMMON_FEEDBACK_CSS_CLASS + " " + super.getCSSClass(message);
    }
}

package pl.tomaszdziurko.jvm_bloggers.view.panels;

import org.apache.wicket.feedback.FeedbackMessage;
import org.apache.wicket.feedback.IFeedbackMessageFilter;
import org.apache.wicket.markup.html.panel.FeedbackPanel;

public class CustomFeedbackPanel extends FeedbackPanel {

    private static final String COMMON_FEEDBACK_CSS_CLASS = "feedbackPanelItem";

    public CustomFeedbackPanel(String id) {
        super(id);
        setOutputMarkupId(true);
        setOutputMarkupPlaceholderTag(true);
    }

    public CustomFeedbackPanel(String id, IFeedbackMessageFilter filter) {
        super(id, filter);
        setOutputMarkupId(true);
        setOutputMarkupPlaceholderTag(true);
    }

    @Override
    protected String getCSSClass(FeedbackMessage message) {
        return COMMON_FEEDBACK_CSS_CLASS + " " + super.getCSSClass(message);
    }
}

Move ajax-related markup methods innto CustomFeedbackPanel so we do not have to call them each time we want to use feedback panel with Ajax