Don't know what happen to my last reply.  Try again:

>i wonder if calling
>feedbackpanel.detach() will help before you add it to the ajax request
>target...

No, this doesn't make the message show up either.

>yes. there is a phase of processing that goes through and collects the
>feedback messages. you are reporting the error after that phase most
l>ikely, so it will get picked up next request.

But why then the error message show in non-Ajax? It should have pass the
feedbackpanel render phase, too.  Yes?  But I must add this behavior is not
consistent, in my small test case, message does not show up at all no matter
Ajax or non-Ajax.  I try moving the feedbackpanel up and down in my template
and didn't make any different.

Is it possible to mark FeedbackPanel "dirty" and then Wicket render it?
Also, seems if Wicket support component render priority of early to late,
then things like FeedbackPanel can say render me last, and problem solve?

I also try "throw new RuntimeException()" and add this in my App:

    @Override public RequestCycle newRequestCycle(Request request, Response
response) {
        return new WebRequestCycle(this, (WebRequest) request, (WebResponse)
response) {
            @Override public Page onRuntimeException(Page page,
RuntimeException e) {
                // ------------------------------------------------------
                // case 1: message DO NOT show
                //
                page.fatal("An error occured: " + e.getCause
().getMessage());
                return page;

                // ------------------------------------------------------
                // case 2: message DO NOT show
                //
                page = new SamePage();
                page.fatal("An error occured: " + e.getCause
().getMessage());
                return page;

                // ------------------------------------------------------
                // case 3: message show
                //
                page = new AnotherPage();
                page.fatal("An error occured: " + e.getCause
().getMessage());
                return page;
            }
        };
    }


Seems Wicket just won't show error message when the page is the same, even
of a newly created instance. There must be some short cut somewhere to not
render page if type is the same.

Small wish: in GMail, when their Ajax submit fails (either user submit or
auto background submit), they don't go to a new page, they flash a message
"System error, trying again."  It would be great if Wicket can support this
way of Ajax error handling when error happen very late during render.

Reply via email to