Bugs item #1561673, was opened at 2006-09-19 21:10
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1561673&group_id=119783

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Stefan Arentz (sateh)
Assigned to: Nobody/Anonymous (nobody)
Summary: ContainerFeedbackMessageFilter problem

Initial Comment:
It it s common pattern to do something like this:

LogInForm logInForm = new LogInForm("logInForm", new 
CompoundPropertyModel(new LogInCommand()));
 add(logInForm);        

add(new FeedbackPanel("feedback" , new 
ContainerFeedbackMessageFilter(logInForm)));

Because of the ContainerFeedbackMessageFilter the error messages 
from the login form are limited to the FeedbackPanel that is relevant 
for the form.

It is also pretty common to do something like this:

class LogInForm extends Form
{
    if (login(....) == false) {
        error("Cannot login or so ...");
    }
}

This will not work though because of the way 
ContainerFeedbackMessageFilter checks whether an error reporter 
matches the filter; it only checks whether the reporter is a child of the 
component specified in the constructor. In case of the Form reporting 
an error from onSubmit the reporter is the form itself!

I fixed this by changing ContainerFeedbackMessageFilter like this:

        public boolean accept(FeedbackMessage message)
        {
                if (message.getReporter() == null)
                {
                        return false;
                }
                else
                {
                        return container.contains(message.getReporter(), true);
                }
        }

To:

        public boolean accept(FeedbackMessage message)
        {
                if (message.getReporter() == null)
                {
                        return false;
                }
                else
                {
                        return container.equals(message.getReporter()) || 
container.contains(message.getReporter(), true);
                }
        }

S.
 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1561673&group_id=119783

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to