Hmm
the code we were looking at was:
class MyFbPanel extends FeedbackPanel {
private final Component component;
MyFbPanel(String id, Component c) {
super(id);
this.component = c;
}
protected IFeedbackMessageFilter getFeedbackMessageFilter()
{
return new ComponentFeedbackMessageFilter(component);
}
}
This is an actual documented Java gotcha, discussed in the JavaOne
presentation More Java Puzzlers, by Neal Gafter and Joshua Blog.
public class JavaPuzzler {
public static void main(String[] args) {
new B("Hello").print();
}
public static abstract class A {
public A() {
print();
}
protected abstract void print();
}
public static class B extends A {
final String foo;
public B(String f) {
super();
this.foo = f;
}
protected void print() {
System.out.println("foo = " + foo);
}
}
}
What do you expect on the console here?
Martijn
On 11/17/05, Matej Knopp <[EMAIL PROTECTED]> wrote:
> Well, it's little more complicated. FeedbackPanel doesn't use the filter
> directly. It uses FeedbackMessagesModel to feed the ListView, and that
> model uses the Filter.
>
> Nevertheless, overriding getFeedbackMessageFilter worked well for me.
> Which version of wicket are you using? I'm using 1.1 and I'm having no
> problems with it.
>
> -Matej
>
> Marco van de Haar wrote:
> > I thought I did that:
> > //in constructor, where fc is the desired component
> > filter = new ComponentFeedbackMessageFilter(fc);
> >
> > and
> >
> > protected IFeedbackMessageFilter getFeedbackMessageFilter()
> > {
> > return filter;
> > }
> >
> > I copied this method from FormComponentFeedbackIndicator where it seems
> > to work..... But my custom FeedbackPanel still shows the errormessages
> > for ALL the invalid components.
> > But I looked at FeedbackPanel's internals and I could not find where the
> > population of the errormessage ListView used the Filter.
> >
> >
> >> Of course it is possible. Just override getFeedbackMessageFilter on it
> >> and provide your own message filter.
> >>
> >> -Matej
> >>
> >> Marco van de Haar wrote:
> >>
> >>> Does anyone know if it is at least possible to make a custom
> >>> FeedbackPanel which displays messages only for a specific component?
> >>>
> >>>> I want to make an extended FeedbackPanel which only shows messages
> >>>> for Component fc.
> >>>> See code below. But when I display my panel I see the
> >>>> feedbackmessages for ALL of the components that are invalid.
> >>>> I checked the toString() for fc:
> >>>> [MarkupContainer [Component id = integerProperty, page = <No Page>,
> >>>> path = inputForm:integerProperty.RequiredTextField]]
> >>>> which I think means it's the required textfield....
> >>>> Does anyone know what I am doing wrong?
> >>>>
> >>>>
> >>>> public class FXTooltipFeedbackPanel extends FeedbackPanel
> >>>> {
> >>>> /** The message filter for this indicator component */
> >>>> private ComponentFeedbackMessageFilter filter;
> >>>> /**
> >>>> * @param id Component id
> >>>> * @param fc formcomponent to display messages for
> >>>> */
> >>>> public FXTooltipFeedbackPanel(String id, FormComponent fc)
> >>>> {
> >>>> super(id);
> >>>> filter = new ComponentFeedbackMessageFilter(fc);
> >>>> }
> >>>> /**
> >>>> * @return Let subclass specify some other filter
> >>>> */
> >>>> protected IFeedbackMessageFilter getFeedbackMessageFilter()
> >>>> {
> >>>> return filter;
> >>>> }
> >>>> protected String getCSSClass(FeedbackMessage message)
> >>>> {
> >>>> return "feedbackTooltipERROR";
> >>>> }
> >>>> }
> >>>>
> >>>
> >>>
> >>>
> >>> -------------------------------------------------------
> >>> This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
> >>> Register for a JBoss Training Course. Free Certification Exam
> >>> for All Training Attendees Through End of 2005. For more info visit:
> >>> http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
> >>> _______________________________________________
> >>> Wicket-user mailing list
> >>> [email protected]
> >>> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>>
> >>
> >>
> >>
> >> -------------------------------------------------------
> >> This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
> >> Register for a JBoss Training Course. Free Certification Exam
> >> for All Training Attendees Through End of 2005. For more info visit:
> >> http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
> >> _______________________________________________
> >> Wicket-user mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
> > Register for a JBoss Training Course. Free Certification Exam
> > for All Training Attendees Through End of 2005. For more info visit:
> > http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
> Register for a JBoss Training Course. Free Certification Exam
> for All Training Attendees Through End of 2005. For more info visit:
> http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
--
Living a wicket life...
Martijn Dashorst - http://www.jroller.com/page/dashorst
Wicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user