IFeedbackMessageFilter feedbackFilter = new IFeedbackMessageFilter() {
public boolean accept(FeedbackMessage message)
{
// If the reporter is a field and this is refreshing because of a non-Ajax form submit, it's very likely that the field has been detached
// from its parent because it is in a list view. As a result, findParent doesn't return the BeanForm.
Component reporter = message.getReporter();
AbstractField reporterField = (AbstractField)(reporter instanceof AbstractField ? reporter : reporter.findParent(AbstractField.class));
if (reporterField != null) {
return reporterField.getBeanForm().getId().equals(BeanForm.this.getId());
}
Component parent = (reporter instanceof BeanForm ? reporter : reporter.findParent(BeanForm.class));
return reporter == BeanForm.this || parent == null || parent == BeanForm.this;
}
};
feedback = new FeedbackPanel("feedback", feedbackFilter);