-Igor
On 6/11/06, Aaron Hiniker <[EMAIL PROTECTED]
> wrote:
I'm digging into this problem a little more.
When my "MessagePanel" renders, the super.isVisible() is returning true... meaning FormComponentFeedbackIndicator returning true. When I attach a debugger to FormComponentFeedbackIndicator#updateFeedback(), the setVisible() calI is passed 'false' value as it should (via the _expression_ getPage().getFeedbackMessages().hasMessage(getFeedbackMessageFilter()).
So how can FormComponentFeedbackIndicator#updateFeedback() perform a setVisible( false ), and then later FormComponentFeedbackIndicator#isVisible() return true in the same render cycle?
Aaron
On Sat, 2006-06-10 at 11:36 -0700, Aaron Hiniker wrote:
I am trying to subclass FormComponentFeedbackIndicator and attach the panel to individual components. My solution works in some scenarios, but with others the panel is always visible (with no messages, just an empty box).
This is my class
public class MessagePanel extends FormComponentFeedbackIndicator {private static Log log = LogFactory.getLog(MessagePanel.class); MarkupContainer parent; public MessagePanel( String id, MarkupContainer parent ) { super( id ); FeedbackPanel feedback = new FeedbackPanel( "messages" ); this.parent = parent; add( feedback ); } @Override protected IFeedbackMessageFilter getFeedbackMessageFilter() { return new IFeedbackMessageFilter() { public boolean accept(FeedbackMessage feedbackMessage) { log.debug( "feedback: " + feedbackMessage ); if ( !feedbackMessage.isInfo() ) return false; return parent.contains( feedbackMessage.getReporter(), true ) || parent == feedbackMessage.getReporter(); } }; } }
and here is the markup:<wicket:panel> <div style="width: 100%; padding-top: 5px; border: 1px solid green; background-color: #F0FFF0"> <span wicket:id="messages">Messages go here</span> </div> </wicket:panel>So the code is attempting to isolate each message panel per-component (by filtering messages not reported by a child of the component). The messages display when they should, and per-component as expected, I just can't figure out how to keep the panel hidden when there are no messages. The isVisible() from FormComponentFeedbackIndicator should hide the panel, right?
Am I even attacking this solution the right way, or is there a better way to do it?
Aaron
_______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
_______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
