Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed title to most common use case, replaced IFeedbackMessageFilter implementation with ContainerFeedbackMessageFilter

If you want to have more than 1 one FeedbackPanel on a page, but don't want to show errors messages in both at the same time use the following to filter the messages.

Code Block
 FeedbackPanel feedbackPanel = new FeedbackPanel("feedback");
 feedbackPanel.setFilter(new IFeedbackMessageFilter() {
     public boolean accept(FeedbackMessage message) {
         if (message.getReporter().getParent() == YourForm.this) {
             return true;
         }
         return false;
    }
 });
 ContainerFeedbackMessageFilter(YourForm.this));
add(feedbackPanel);

The line

if (message.getReporter().getParent() == Now only error messages reported by (direct or indirect) children of YourForm.this ) {will check to see if the reporting form component is from the form you added your FeedbackPanel towill be shown in the FeedbackPanel.