The problem I had with FeedbackPanel is that it doesn't allow me to change the CSS style based on the kinds of messages it contains. So, with some help from wicket-user, I was able to put this together:
public class CSSFeedbackPanel extends FeedbackPanel { public CSSFeedbackPanel(final String id) { super(id); WebMarkupContainer feedbackul = (WebMarkupContainer) get("feedbackul"); if (feedbackul != null) { feedbackul.add(new AttributeModifier("class", true, new Model() { public Object getObject(Component comp) { if (anyMessage()) { if (anyMessage(FeedbackMessage.INFO)) { return "feedbackulINFO"; } else if (anyMessage(FeedbackMessage.ERROR)) { return "feedbackulERROR"; } else { return "feedbackulNONE"; } } else { return "feedbackulNONE"; } } })); } } }
It's just a drop-in replacement for FeedbackPanel that changes the CSS style based on the type of messages contained. The problem is that it doesn't work well if there are multiple message types in the panel.