I think I found the reason:
/**
* If it's an ajax request we always redirect.
*
* @see org.apache.wicket.RequestCycle#isRedirect()
*/
public final boolean isRedirect()
{
if (getWebRequest().isAjax())
{
return true;
}
else
{
return super.isRedirect();
}
}
This is inside WebRequestCycle. Can someone explain why if it's an ajax
request it's always a redirect?
On 10/15/07, Adam Koch <[EMAIL PROTECTED]> wrote:
>
> I'm having a problem with the feedback panel in conjunction with the
> AjaxButton and setResponsePage(). There are two pages, a home page and a sub
> page. When the user submits a form successfully on the sub page, I would
> like the home page to display with an informational message.
>
> Here is some code:
> // my form
> add(new AjaxButton("submitButton", this) {
> protected void onSubmit(AjaxRequestTarget target, Form form) {
> // nothing, want the form submit to do the work
> }
> protected void onError(...) {
> // refresh the feedback panel without refreshing any page
> });
>
> protected void onSubmit() {
> info("successful!");
> setRedirect(false);
> setResponsePage(HomePage.class);
> }
>
> What happens is the new page is displayed, but the info message isn't.
>
> If I use a regular Button, this works, but then I don't get the Ajax
> validation of the form.
> And if I don't set the response page to another page, then this also
> works. (Well, maybe not _that_ code, but the feedback can be refreshed with
> an info message.)
>
> Can anybody help me? I'm not sure what else I can do to debug this.
>
> Thanks,
> Adam
--
Adam A. Koch
http://www.outofthemold.com/