I don't know whether it is that uncommon. Now that I think of it, I
can think of a few use cases, certainly when you want to handle
exceptional situations.

But Paolo, please tell us more about your use case. Are you sure you
want to redirect to a page there?

Eelco


On 7/21/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> sure, we could add a utility method. but think about what you are doing -
> you want to redirect a browser from an /ajax/ request. this is not a common
> usecase i dont think. the whole point of ajax is to work on the same page
> and avoid the redirects :)
>
> -Igor
>
>
>
> On 7/21/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > Could we make AjaxRequestTarget a bit smarter so that it would have a
> > setResponsePage method that translates to window.location= instead of
> > the redirect we do for normal requests?
> >
> > Eelco
> >
> >
> > On 7/21/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
> > >
> target.addJavascript("window.location='"+RequstCycle.get().urlFor(null,
> > > MyPage.class)+"';");
> > >
> > > you can only redirect to a class not an instance so you will have to
> pass
> > > params using PageParameters.
> > >
> > > maybe we should add urlFor(Page) to request cycle
> > >
> > > -Igor
> > >
> > >
> > >
> > > On 7/21/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:
> > > >
> > >
> > > I'm getting a bit confused how to redirect to a new page after a form
> > > submission using AjaxFormSubmitBehavior.
> > >
> > > I use the onSubmit method of AjaxFormSubmitBehavior component to notify
> user
> > > for special message, for example:
> > >
> > >  buttonSave.add( new AjaxFormSubmitBehavior ( form, "onclick" ) {
> > >     protected void onSubmit(AjaxRequestTarget target) {
> > >         if( !getFeedbackMessages().isEmpty() ) {
> > >              target.addJavascript( "alert('Validation failed')" );
> > >         }
> > >      }
> > > });
> > >
> > >
> > > and the form onSubmit to save data and redirect to the next page:
> > >
> > > form = new Form("form1") {
> > >
> > >    void onSubmit() {
> > >
> > >      if( findSubmittingButton() == buttonSave ) {
> > >
> > >        dao.save( object );
> > >       setResponsePage( NextPage.class );
> > >     }
> > >   }
> > >  };
> > >
> > > The problem is that in this way I will get the response page as response
> > > content of the Ajax call!
> > >
> > > How to redirect to another page using AjaxFormSubmitBehavior?
> > >
> > >
> > > Thanks for helping.
> > >
> > >
> > > - Paolo
> > >
> > >
> > >
> -------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > > opinions on IT & business topics through brief surveys -- and earn cash
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > >
> > > _______________________________________________
> > > Wicket-user mailing list
> > >   Wicket-user@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> > >
> > >
> > >
> > >
> -------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > > opinions on IT & business topics through brief surveys -- and earn cash
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > >
> > > _______________________________________________
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> > >
> > >
> >
> >
> -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > opinions on IT & business topics through brief surveys -- and earn cash
> >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to