if you want to display an entirely new page from an ajax request then yes,
you have to redirect. whether that is done via a window.location or another
method doesnt matter...

-igor


On 10/15/07, Adam Koch <[EMAIL PROTECTED]> wrote:
>
> That seems easy enough. Thanks!
>
> Tell me if this is right. If we send an Ajax request from the browser,
> then
> the only way to get it to refresh the page is to tell it to redirect.
> That's
> why all Ajax calls that have render a new page have to redirect.
>
> Thanks,
> Adam
>
> On 10/15/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> >
> > if you have feedback messages that need to last across requests/pages
> you
> > need to use getsession().info() instead
> >
> > -igor
> >
> >
> > 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/
>

Reply via email to