Oops, accidently hit ctrl+return to send..

These aren't exceptions, they are just new Throwable().printStackTrace() to see where and when isVisible() is being called

stack trace from non-working application:

19:54:36,115 ERROR [STDERR] java.lang.Throwable
19:54:36,116 ERROR [STDERR]     at com.hindog.wicket.form.ErrorMessagePanel.isVisible(ErrorMessagePanel.java:62)
19:54:36,117 ERROR [STDERR]     at wicket.Component.render(Component.java:1497)
19:54:36,117 ERROR [STDERR]     at wicket.MarkupContainer.renderNext(MarkupContainer.java:1332)
19:54:36,117 ERROR [STDERR]     at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:980)
19:54:36,117 ERROR [STDERR]     at wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:571)
19:54:36,118 ERROR [STDERR]     at wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:108)
19:54:36,118 ERROR [STDERR]     at wicket.Component.renderComponent(Component.java:1675)
19:54:36,118 ERROR [STDERR]     at wicket.MarkupContainer.onRender(MarkupContainer.java:925)
19:54:36,118 ERROR [STDERR]     at wicket.Component.render(Component.java:1511)
19:54:36,118 ERROR [STDERR]     at wicket.MarkupContainer.renderNext(MarkupContainer.java:1332)
19:54:36,119 ERROR [STDERR]     at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:980)
19:54:36,119 ERROR [STDERR]     at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:915)
19:54:36,119 ERROR [STDERR]     at wicket.markup.html.panel.Fragment.renderFragment(Fragment.java:258)
19:54:36,119 ERROR [STDERR]     at wicket.markup.html.panel.Fragment.onComponentTagBody(Fragment.java:200)
19:54:36,120 ERROR [STDERR]     at wicket.Component.renderComponent(Component.java:1675)
19:54:36,120 ERROR [STDERR]     at wicket.MarkupContainer.onRender(MarkupContainer.java:925)
19:54:36,120 ERROR [STDERR]     at wicket.Component.render(Component.java:1511)
19:54:36,120 ERROR [STDERR]     at wicket.MarkupContainer.renderNext(MarkupContainer.java:1332)
19:54:36,121 ERROR [STDERR]     at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:980)
19:54:36,121 ERROR [STDERR]     at wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:571)
19:54:36,121 ERROR [STDERR]     at wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:108)
19:54:36,121 ERROR [STDERR]     at wicket.Component.renderComponent(Component.java:1675)
19:54:36,121 ERROR [STDERR]     at wicket.MarkupContainer.onRender(MarkupContainer.java:925)
19:54:36,122 ERROR [STDERR]     at wicket.Component.render(Component.java:1511)
19:54:36,122 ERROR [STDERR]     at wicket.Component.renderComponent(Component.java:1613)
19:54:36,122 ERROR [STDERR]     at wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:422)
19:54:36,122 ERROR [STDERR]     at wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:310)
19:54:36,122 ERROR [STDERR]     at wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49)
19:54:36,123 ERROR [STDERR]     at wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
19:54:36,123 ERROR [STDERR]     at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:852)
19:54:36,123 ERROR [STDERR]     at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:879)
19:54:36,123 ERROR [STDERR]     at wicket.RequestCycle.step(RequestCycle.java:960)
19:54:36,124 ERROR [STDERR]     at wicket.RequestCycle.steps(RequestCycle.java:1034)
19:54:36,124 ERROR [STDERR]     at wicket.RequestCycle.request(RequestCycle.java:453)



And in the same application, another portion of the code where the visiblity works as expected, I see basically the same stack trace as before ( looking at the last 5 in the call stack ), but *in addition* I also see another method call coming from Component#isVisibleInHierarchy().  Why does it work when I see this following invocation stack to isVisible() ?  (Note same thing in QuickStart, application worked as expected and had two stack traces [or two different invocation stacks to isVisible], and the non-working instances always have a single invocation stack with Component#render() calling isVisible() )

20:01:03,396 ERROR [STDERR] java.lang.Throwable
20:01:03,397 ERROR [STDERR]     at com.hindog.wicket.form.ErrorMessagePanel.isVisible(ErrorMessagePanel.java:62)
20:01:03,397 ERROR [STDERR]     at wicket.Component.isVisibleInHierarchy(Component.java:1362)
20:01:03,397 ERROR [STDERR]     at wicket.Page$8.component(Page.java:1076)
20:01:03,397 ERROR [STDERR]     at wicket.MarkupContainer.visitChildren(MarkupContainer.java:742)
20:01:03,397 ERROR [STDERR]     at wicket.MarkupContainer.visitChildren(MarkupContainer.java:757)
20:01:03,397 ERROR [STDERR]     at wicket.MarkupContainer.visitChildren(MarkupContainer.java:782)
20:01:03,397 ERROR [STDERR]     at wicket.Page.checkRendering(Page.java:1062)
20:01:03,397 ERROR [STDERR]     at wicket.Page.renderPage(Page.java:419)
20:01:03,397 ERROR [STDERR]     at wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:226)
20:01:03,397 ERROR [STDERR]     at wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49)
20:01:03,397 ERROR [STDERR]     at wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
20:01:03,397 ERROR [STDERR]     at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:852)
20:01:03,397 ERROR [STDERR]     at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:879)
20:01:03,397 ERROR [STDERR]     at wicket.RequestCycle.step(RequestCycle.java:960)
20:01:03,397 ERROR [STDERR]     at wicket.RequestCycle.steps(RequestCycle.java:1034)
20:01:03,397 ERROR [STDERR]     at wicket.RequestCycle.request(RequestCycle.java:453)


Sorry that I can't duplicated it, I'm not sure what conditions are causing this yet.

Aaron


On Sun, 2006-06-11 at 19:58 -0700, Aaron Hiniker wrote:
In my initial attempts, I can't replicate the problem in a quickstart application.

Perhaps the stack traces being different could lead to some ideas:


On Sun, 2006-06-11 at 18:48 -0700, Igor Vaynberg wrote:
create a quickstart project so that we can see the problem.

-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
_______________________________________________
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

Reply via email to