Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Igor Vaynberg
i think the default behavior should be to just output the redirect _javascript_ and ignore everything else in the response. in case someone has an edge case that requires some _javascript_ they can easily implement window.location
 script themselves. maybe adding requestcycle.urlfor(Page page) will be good also to help with the latter usecase.-IgorOn 7/25/06, Eelco Hillenius
 <[EMAIL PROTECTED]> wrote:
We could do that too. Do you think any script should be executed, orif such a page (rather request target, let's keep things generic here)is set, should anything else be disregarded?EelcoOn 7/25/06, Igor Vaynberg <
[EMAIL PROTECTED]> wrote:> the answer would be to add setresponsepage on the ajaxrequesttarget that> would keep the settings and at the end of processing /append/ the _javascript_
> call. so you can call setresponsepage multiple times, but only the last call> matters. and requestcycle can just forward to that method on the target.>> -Igor On 7/25/06, Eelco Hillenius <
[EMAIL PROTECTED]> wrote:> >>  That's why I asked you that question on ##wicket. PrependJavaScript> now adds to a list. I think the name implies that it should be added
> in front of everything. That would fix that potential problem. If not,> I thought about exposing getPrependJavaScripts or something, so that I> could do the filtering myself.>> I didn't add a TODO as I was just waiting for your answer so that I
> could fix it right away. So... the answer...>> Eelco>>> On 7/25/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:> > what happens if you call setresponsepage twice, since both _javascript_s are
> > output i think the first one will be followed instead of the second one> > which is in contradition to how it works on regular requsts.> >> > -Igor> >> >
> >> > On 7/25/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:> > >> >  I just checked in a fix (will thus be in Wicket 1.2.2
 and Wicket 2.0)> > so that you can directly set the response page like you would do in> > normal requests:> >> > add(new AjaxLink("set-response-page")> > {> >  public void onClick(AjaxRequestTarget target)
> > {> > setResponsePage(LinksPage.class);> > }> > });> >> > Eelco> >> >> >> > On 7/25/06, Paolo Di Tommaso < 
[EMAIL PROTECTED]> wrote:> > > With getSession().touch(page); it works!> > >> > > Thank you!> > >> > >
> > > - Paolo> > >> > > On 7/25/06, Johan Compagner < [EMAIL PROTECTED] > wrote:> > > >> > > > ahh
> > > > after the url for do this:> > > >> > > > session.touch(page);> > > >> > > > We should hide this for you somehow..> >  > >
> > > > I do hope that the page is not stateless anymore at that time> > > > Can you debug that a bit.. So after the urlFor() output the> > > page.isStateless()> > > >
> > > >> > > > johan> > > >> > > >> > > >> > > >> > > >> > > >> > > > On 7/25/06, Paolo Di Tommaso < 
[EMAIL PROTECTED]> wrote:> > > >> > > > >> > > >> > > >> > > > I'm using an AjaxFormSubmitBehavior to submit form data.
> > > >> > > > I would like to use ajax behaviour because if there are validation> error> > I> > > can notify user for errors without reloading page again.
> > > >> > > > If validation is OK I need to move to the next page in the application> > > flow so in the onSubmit method for AjaxFormSubmitBehavior I write> > > >
> > > >> > > > protected void onSubmit(AjaxRequestTarget target) {> > > > if( getFeedbackMessages().isEmpty() ) {> > > >> > > > MyPage page = new MyPage(...);
> > > > String url = "" RequestCycle.get().urlFor(page,> > > IRedirectListener.INTERFACE );> > > >>  > > > target.addJavascript ( "window.location
 = '" +url+ "'" );> > > >> > > >> > > > } else {> > > > target.addJavascript("alert('"+ getJavascriptFeedbackMessage()
> > > +"')");> > > > }> > > > }> > > >> > > >> > > > Thanks, Paolo> > > >> > > >> > > >
> > > >> > > >> > > >> > > >> > > >> >  > > On 7/25/06, Johan Compagner < [EMAIL PROTECTED]
> wrote:> > > > >> > > > > need to see some more code or a test case.> > > > >> > > > >> > > > >> > > > > On 7/25/06, Paolo Di Tommaso < 
[EMAIL PROTECTED]> wrote:> > > > >> > > > > >> > > > >> > > > >> > > > > I'm trying to redirect after an ajax request doing something like
> > that:> > > > >> > > > > String url = "" RequestCycle.get().urlFor(myPageInstance,> > > IRedirectListener.INTERFACE );> > > > > target.addJavascript
( "window.location = '" +url+ "'" );> > > > >> > > > > But always get an "Page Expired" error page.> > > > >> > > > > Is it possible to redirect to a page instance?
> > > > >> > > > > Thanks, 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/

Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Eelco Hillenius
We could do that too. Do you think any script should be executed, or
if such a page (rather request target, let's keep things generic here)
is set, should anything else be disregarded?

Eelco


On 7/25/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> the answer would be to add setresponsepage on the ajaxrequesttarget that
> would keep the settings and at the end of processing /append/ the javascript
> call. so you can call setresponsepage multiple times, but only the last call
> matters. and requestcycle can just forward to that method on the target.
>
> -Igor
>
>
>
> On 7/25/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> >
>  That's why I asked you that question on ##wicket. PrependJavaScript
> now adds to a list. I think the name implies that it should be added
> in front of everything. That would fix that potential problem. If not,
> I thought about exposing getPrependJavaScripts or something, so that I
> could do the filtering myself.
>
> I didn't add a TODO as I was just waiting for your answer so that I
> could fix it right away. So... the answer...
>
> Eelco
>
>
> On 7/25/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
> > what happens if you call setresponsepage twice, since both javascripts are
> > output i think the first one will be followed instead of the second one
> > which is in contradition to how it works on regular requsts.
> >
> > -Igor
> >
> >
> >
> > On 7/25/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > >
> >  I just checked in a fix (will thus be in Wicket 1.2.2 and Wicket 2.0)
> > so that you can directly set the response page like you would do in
> > normal requests:
> >
> > add(new AjaxLink("set-response-page")
> > {
> >  public void onClick(AjaxRequestTarget target)
> > {
> > setResponsePage(LinksPage.class);
> > }
> > });
> >
> > Eelco
> >
> >
> >
> > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:
> > > With getSession().touch(page); it works!
> > >
> > > Thank you!
> > >
> > >
> > > - Paolo
> > >
> > > On 7/25/06, Johan Compagner < [EMAIL PROTECTED] > wrote:
> > > >
> > > > ahh
> > > > after the url for do this:
> > > >
> > > > session.touch(page);
> > > >
> > > > We should hide this for you somehow..
> >  > >
> > > > I do hope that the page is not stateless anymore at that time
> > > > Can you debug that a bit.. So after the urlFor() output the
> > > page.isStateless()
> > > >
> > > >
> > > > johan
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:
> > > >
> > > > >
> > > >
> > > >
> > > > I'm using an AjaxFormSubmitBehavior to submit form data.
> > > >
> > > > I would like to use ajax behaviour because if there are validation
> error
> > I
> > > can notify user for errors without reloading page again.
> > > >
> > > > If validation is OK I need to move to the next page in the application
> > > flow so in the onSubmit method for AjaxFormSubmitBehavior I write
> > > >
> > > >
> > > > protected void onSubmit(AjaxRequestTarget target) {
> > > > if( getFeedbackMessages().isEmpty() ) {
> > > >
> > > > MyPage page = new MyPage(...);
> > > > String url = (String) RequestCycle.get().urlFor(page,
> > > IRedirectListener.INTERFACE );
> > > >
>  > > > target.addJavascript ( "window.location = '" +url+ "'" );
> > > >
> > > >
> > > > } else {
> > > > target.addJavascript("alert('"+ getJavascriptFeedbackMessage()
> > > +"')");
> > > > }
> > > > }
> > > >
> > > >
> > > > Thanks, Paolo
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> >  > > On 7/25/06, Johan Compagner < [EMAIL PROTECTED]> wrote:
> > > > >
> > > > > need to see some more code or a test case.
> > > > >
> > > > >
> > > > >
> > > > > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:
> > > > >
> > > > > >
> > > > >
> > > > >
> > > > > I'm trying to redirect after an ajax request doing something like
> > that:
> > > > >
> > > > > String url = (String) RequestCycle.get().urlFor(myPageInstance,
> > > IRedirectListener.INTERFACE );
> > > > > target.addJavascript( "window.location = '" +url+ "'" );
> > > > >
> > > > > But always get an "Page Expired" error page.
> > > > >
> > > > > Is it possible to redirect to a page instance?
> > > > >
> > > > > Thanks, 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

Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Igor Vaynberg
the answer would be to add setresponsepage on the ajaxrequesttarget that would keep the settings and at the end of processing /append/ the _javascript_ call. so you can call setresponsepage multiple times, but only the last call matters. and requestcycle can just forward to that method on the target.
-IgorOn 7/25/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
That's why I asked you that question on ##wicket. PrependJavaScriptnow adds to a list. I think the name implies that it should be addedin front of everything. That would fix that potential problem. If not,I thought about exposing getPrependJavaScripts or something, so that I
could do the filtering myself.I didn't add a TODO as I was just waiting for your answer so that Icould fix it right away. So... the answer...EelcoOn 7/25/06, Igor Vaynberg <
[EMAIL PROTECTED]> wrote:> what happens if you call setresponsepage twice, since both _javascript_s are> output i think the first one will be followed instead of the second one> which is in contradition to how it works on regular requsts.
>> -Igor On 7/25/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:> >>  I just checked in a fix (will thus be in Wicket 
1.2.2 and Wicket 2.0)> so that you can directly set the response page like you would do in> normal requests:>> add(new AjaxLink("set-response-page")> {>  public void onClick(AjaxRequestTarget target)
> {> setResponsePage(LinksPage.class);> }> });>> Eelco On 7/25/06, Paolo Di Tommaso < 
[EMAIL PROTECTED]> wrote:> > With getSession().touch(page); it works!> >> > Thank you!> >> >> > - Paolo> >> > On 7/25/06, Johan Compagner < 
[EMAIL PROTECTED] > wrote:> > >> > > ahh> > > after the url for do this:> > >> > > session.touch(page);> > >
> > > We should hide this for you somehow..>  > >> > > I do hope that the page is not stateless anymore at that time> > > Can you debug that a bit.. So after the urlFor() output the
> > page.isStateless()> > >> > >> > > johan> > >> > >> > >> > >> > >> > >> > > On 7/25/06, Paolo Di Tommaso < 
[EMAIL PROTECTED]> wrote:> > >> > > >> > >> > >> > > I'm using an AjaxFormSubmitBehavior to submit form data.
> > >> > > I would like to use ajax behaviour because if there are validation error> I> > can notify user for errors without reloading page again.> > >> > > If validation is OK I need to move to the next page in the application
> > flow so in the onSubmit method for AjaxFormSubmitBehavior I write> > >> > >> > > protected void onSubmit(AjaxRequestTarget target) {> > > if( getFeedbackMessages().isEmpty() ) {
> > >> > > MyPage page = new MyPage(...);> > > String url = "" RequestCycle.get().urlFor(page,> > IRedirectListener.INTERFACE );> > >
> > > target.addJavascript ( "window.location = '" +url+ "'" );> > >> > >> > > } else {> > > target.addJavascript("alert('"+ getJavascriptFeedbackMessage()
> > +"')");> > > }> > > }> > >> > >> > > Thanks, Paolo> > >> > >> > >> > >> > >
> > >> > >> > >>  > > On 7/25/06, Johan Compagner < [EMAIL PROTECTED]> wrote:> > > >> > > > need to see some more code or a test case.
> > > >> > > >> > > >> > > > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:> > > >
> > > > >> > > >> > > >> > > > I'm trying to redirect after an ajax request doing something like> that:> > > >> > > > String url = "" 
RequestCycle.get().urlFor(myPageInstance,> > IRedirectListener.INTERFACE );> > > > target.addJavascript( "window.location = '" +url+ "'" );> > > >> > > > But always get an "Page Expired" error page.
> > > >> > > > Is it possible to redirect to a page instance?> > > >> > > > Thanks, 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 Ca

Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Eelco Hillenius
That's why I asked you that question on ##wicket. PrependJavaScript
now adds to a list. I think the name implies that it should be added
in front of everything. That would fix that potential problem. If not,
I thought about exposing getPrependJavaScripts or something, so that I
could do the filtering myself.

I didn't add a TODO as I was just waiting for your answer so that I
could fix it right away. So... the answer...

Eelco


On 7/25/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> what happens if you call setresponsepage twice, since both javascripts are
> output i think the first one will be followed instead of the second one
> which is in contradition to how it works on regular requsts.
>
> -Igor
>
>
>
> On 7/25/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> >
>  I just checked in a fix (will thus be in Wicket 1.2.2 and Wicket 2.0)
> so that you can directly set the response page like you would do in
> normal requests:
>
> add(new AjaxLink("set-response-page")
> {
>  public void onClick(AjaxRequestTarget target)
> {
> setResponsePage(LinksPage.class);
> }
> });
>
> Eelco
>
>
>
> On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:
> > With getSession().touch(page); it works!
> >
> > Thank you!
> >
> >
> > - Paolo
> >
> > On 7/25/06, Johan Compagner < [EMAIL PROTECTED] > wrote:
> > >
> > > ahh
> > > after the url for do this:
> > >
> > > session.touch(page);
> > >
> > > We should hide this for you somehow..
>  > >
> > > I do hope that the page is not stateless anymore at that time
> > > Can you debug that a bit.. So after the urlFor() output the
> > page.isStateless()
> > >
> > >
> > > johan
> > >
> > >
> > >
> > >
> > >
> > >
> > > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:
> > >
> > > >
> > >
> > >
> > > I'm using an AjaxFormSubmitBehavior to submit form data.
> > >
> > > I would like to use ajax behaviour because if there are validation error
> I
> > can notify user for errors without reloading page again.
> > >
> > > If validation is OK I need to move to the next page in the application
> > flow so in the onSubmit method for AjaxFormSubmitBehavior I write
> > >
> > >
> > > protected void onSubmit(AjaxRequestTarget target) {
> > > if( getFeedbackMessages().isEmpty() ) {
> > >
> > > MyPage page = new MyPage(...);
> > > String url = (String) RequestCycle.get().urlFor(page,
> > IRedirectListener.INTERFACE );
> > >
> > > target.addJavascript ( "window.location = '" +url+ "'" );
> > >
> > >
> > > } else {
> > > target.addJavascript("alert('"+ getJavascriptFeedbackMessage()
> > +"')");
> > > }
> > > }
> > >
> > >
> > > Thanks, Paolo
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
>  > > On 7/25/06, Johan Compagner < [EMAIL PROTECTED]> wrote:
> > > >
> > > > need to see some more code or a test case.
> > > >
> > > >
> > > >
> > > > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:
> > > >
> > > > >
> > > >
> > > >
> > > > I'm trying to redirect after an ajax request doing something like
> that:
> > > >
> > > > String url = (String) RequestCycle.get().urlFor(myPageInstance,
> > IRedirectListener.INTERFACE );
> > > > target.addJavascript( "window.location = '" +url+ "'" );
> > > >
> > > > But always get an "Page Expired" error page.
> > > >
> > > > Is it possible to redirect to a page instance?
> > > >
> > > > Thanks, 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
> >
> h

Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Igor Vaynberg
what happens if you call setresponsepage twice, since both _javascript_s are output i think the first one will be followed instead of the second one which is in contradition to how it works on regular requsts.-Igor
On 7/25/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
I just checked in a fix (will thus be in Wicket 1.2.2 and Wicket 2.0)so that you can directly set the response page like you would do innormal requests:add(new AjaxLink("set-response-page"){
public void onClick(AjaxRequestTarget target){setResponsePage(LinksPage.class);}});EelcoOn 7/25/06, Paolo Di Tommaso <
[EMAIL PROTECTED]> wrote:> With getSession().touch(page); it works!>> Thank you!>>> - Paolo>> On 7/25/06, Johan Compagner <
[EMAIL PROTECTED] > wrote:> >> > ahh> > after the url for do this:> >> > session.touch(page);> >> > We should hide this for you somehow..
> >> > I do hope that the page is not stateless anymore at that time> > Can you debug that a bit.. So after the urlFor() output the> page.isStateless()> >> >> > johan
> >> >> >> >> >> >> > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:> >
> > >> >> >> > I'm using an AjaxFormSubmitBehavior to submit form data.> >> > I would like to use ajax behaviour because if there are validation error I> can notify user for errors without reloading page again.
> >> > If validation is OK I need to move to the next page in the application> flow so in the onSubmit method for AjaxFormSubmitBehavior I write> >> >> > protected void onSubmit(AjaxRequestTarget target) {
> > if( getFeedbackMessages().isEmpty() ) {> >> > MyPage page = new MyPage(...);> > String url = "" RequestCycle.get().urlFor(page,> IRedirectListener.INTERFACE
 );> >> > target.addJavascript ( "window.location = '" +url+ "'" );> >> >> > } else {> > target.addJavascript("alert('"+ getJavascriptFeedbackMessage()
> +"')");> > }> > }> >> >> > Thanks, Paolo> >> >> >> >> >> >> >> >
> > On 7/25/06, Johan Compagner < [EMAIL PROTECTED]> wrote:> > >> > > need to see some more code or a test case.> > >> > >
> > >> > > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:> > >> > > >> > >> > >
> > > I'm trying to redirect after an ajax request doing something like that:> > >> > > String url = "" RequestCycle.get().urlFor(myPageInstance,> IRedirectListener.INTERFACE
 );> > > target.addJavascript( "window.location = '" +url+ "'" );> > >> > > But always get an "Page Expired" error page.> > >> > > Is it possible to redirect to a page instance?
> > >> > > Thanks, 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 ITJoin SourceForge.net's Techsay panel and you'll get the chance to share youropinions 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 listWicket-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

Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Eelco Hillenius
I just checked in a fix (will thus be in Wicket 1.2.2 and Wicket 2.0)
so that you can directly set the response page like you would do in
normal requests:

add(new AjaxLink("set-response-page")
{
public void onClick(AjaxRequestTarget target)
{
setResponsePage(LinksPage.class);
}
});

Eelco



On 7/25/06, Paolo Di Tommaso <[EMAIL PROTECTED]> wrote:
> With getSession().touch(page); it works!
>
> Thank you!
>
>
> - Paolo
>
> On 7/25/06, Johan Compagner <[EMAIL PROTECTED] > wrote:
> >
> > ahh
> > after the url for do this:
> >
> > session.touch(page);
> >
> > We should hide this for you somehow..
> >
> > I do hope that the page is not stateless anymore at that time
> > Can you debug that a bit.. So after the urlFor() output the
> page.isStateless()
> >
> >
> > johan
> >
> >
> >
> >
> >
> >
> > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:
> >
> > >
> >
> >
> > I'm using an AjaxFormSubmitBehavior to submit form data.
> >
> > I would like to use ajax behaviour because if there are validation error I
> can notify user for errors without reloading page again.
> >
> > If validation is OK I need to move to the next page in the application
> flow so in the onSubmit method for AjaxFormSubmitBehavior I write
> >
> >
> > protected void onSubmit(AjaxRequestTarget target) {
> > if( getFeedbackMessages().isEmpty() ) {
> >
> > MyPage page = new MyPage(...);
> > String url = (String) RequestCycle.get().urlFor(page,
> IRedirectListener.INTERFACE );
> >
> > target.addJavascript ( "window.location = '" +url+ "'" );
> >
> >
> > } else {
> > target.addJavascript("alert('"+ getJavascriptFeedbackMessage()
> +"')");
> > }
> > }
> >
> >
> > Thanks, Paolo
> >
> >
> >
> >
> >
> >
> >
> >
> > On 7/25/06, Johan Compagner < [EMAIL PROTECTED]> wrote:
> > >
> > > need to see some more code or a test case.
> > >
> > >
> > >
> > > On 7/25/06, Paolo Di Tommaso < [EMAIL PROTECTED]> wrote:
> > >
> > > >
> > >
> > >
> > > I'm trying to redirect after an ajax request doing something like that:
> > >
> > > String url = (String) RequestCycle.get().urlFor(myPageInstance,
> IRedirectListener.INTERFACE );
> > > target.addJavascript( "window.location = '" +url+ "'" );
> > >
> > > But always get an "Page Expired" error page.
> > >
> > > Is it possible to redirect to a page instance?
> > >
> > > Thanks, 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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Paolo Di Tommaso
With getSession().touch(page); it works!Thank you!- PaoloOn 7/25/06, Johan Compagner <[EMAIL PROTECTED]
> wrote:ahhafter the url for do this:session.touch(page);
We should hide this for you somehow..I do hope that the page is not stateless anymore at that timeCan you debug that a bit.. So after the urlFor() output the 
page.isStateless()johanOn 7/25/06, Paolo Di Tommaso <


[EMAIL PROTECTED]> wrote:
I'm using an AjaxFormSubmitBehavior to submit form data. 
I would like to use ajax behaviour because if there are validation error I can notify user for errors without reloading page again. If validation is OK I need to move to the next page in the application flow so in the onSubmit method for AjaxFormSubmitBehavior I write 
protected void onSubmit(AjaxRequestTarget target) {


    if( getFeedbackMessages().isEmpty() ) { 
        MyPage page = new MyPage(...);



        String url = "" RequestCycle.get().urlFor(page, IRedirectListener.INTERFACE );
        target.addJavascript
( "window.location = '" +url+ "'" );        



    } else {         target.addJavascript("alert('"+ getJavascriptFeedbackMessage() +"')");
    }}



Thanks, PaoloOn 7/25/06, Johan Compagner <


[EMAIL PROTECTED]> wrote:
need to see some more code or a test case.On 7/25/06, Paolo Di Tommaso <



[EMAIL PROTECTED]> wrote:

I'm trying to redirect after an ajax request doing something like that: 
String url = "" RequestCycle.get().urlFor(myPageInstance, IRedirectListener.INTERFACE );target.addJavascript( "window.location = '" +url+ "'" );
But always get an "Page Expired" error page.Is it possible to redirect to a page instance? Thanks, Paolo


-Take Surveys. Earn Cash. Influence the Future of ITJoin 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 ITJoin 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.nethttps://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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Johan Compagner
ahhafter the url for do this:session.touch(page);We should hide this for you somehow..I do hope that the page is not stateless anymore at that timeCan you debug that a bit.. So after the urlFor() output the 
page.isStateless()johanOn 7/25/06, Paolo Di Tommaso <

[EMAIL PROTECTED]> wrote:I'm using an AjaxFormSubmitBehavior to submit form data. 
I would like to use ajax behaviour because if there are validation error I can notify user for errors without reloading page again. If validation is OK I need to move to the next page in the application flow so in the onSubmit method for AjaxFormSubmitBehavior I write 
protected void onSubmit(AjaxRequestTarget target) {

    if( getFeedbackMessages().isEmpty() ) { 
        MyPage page = new MyPage(...);


        String url = "" RequestCycle.get().urlFor(page, IRedirectListener.INTERFACE );
        target.addJavascript
( "window.location = '" +url+ "'" );        


    } else {         target.addJavascript("alert('"+ getJavascriptFeedbackMessage() +"')");
    }}


Thanks, PaoloOn 7/25/06, Johan Compagner <

[EMAIL PROTECTED]> wrote:
need to see some more code or a test case.On 7/25/06, Paolo Di Tommaso <


[EMAIL PROTECTED]> wrote:

I'm trying to redirect after an ajax request doing something like that: 
String url = "" RequestCycle.get().urlFor(myPageInstance, IRedirectListener.INTERFACE );target.addJavascript( "window.location = '" +url+ "'" );
But always get an "Page Expired" error page.Is it possible to redirect to a page instance? Thanks, Paolo


-Take Surveys. Earn Cash. Influence the Future of ITJoin 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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Matej Knopp
Johan Compagner wrote:
> need to see some more code or a test case.
> 
> On 7/25/06, *Paolo Di Tommaso* <[EMAIL PROTECTED] 
> > wrote:
> 
> I'm trying to redirect after an ajax request doing something like that:
> 
> String url = (String) RequestCycle.get().urlFor(myPageInstance,
> IRedirectListener.INTERFACE );
> target.addJavascript( "window.location = '" +url+ "'" );
> 
> But always get an "Page Expired" error page.
> 
> Is it possible to redirect to a page instance?
> 
> Thanks, Paolo
> 
Couldn't this be because the page is not stored in the pagemap yet?

-Matej
> 
> 
> 
> On 7/21/06, * Johan Compagner* <[EMAIL PROTECTED]
> > wrote:
> 
> 
> 
> maybe we should add urlFor(Page) to request cycle 
> 
> 
> 
> whats wrong with:
> 
> RequestCycle.get().urlFor(page,IRedirectListener.INTERFACE)
> 
> ??
> 
> johan
> 
> 
> 
> 
> -
> 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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Paolo Di Tommaso
I'm using an AjaxFormSubmitBehavior to submit form data. I would like to use ajax behaviour because if there are validation error I can notify user for errors without reloading page again. If validation is OK I need to move to the next page in the application flow so in the onSubmit method for AjaxFormSubmitBehavior I write 
protected void onSubmit(AjaxRequestTarget target) {    if( getFeedbackMessages().isEmpty() ) { 
        MyPage page = new MyPage(...);
        String url = "" RequestCycle.get().urlFor(page, IRedirectListener.INTERFACE );        target.addJavascript
( "window.location = '" +url+ "'" );        
    } else {         target.addJavascript("alert('"+ getJavascriptFeedbackMessage() +"')");
    }}
Thanks, PaoloOn 7/25/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
need to see some more code or a test case.On 7/25/06, Paolo Di Tommaso <
[EMAIL PROTECTED]> wrote:

I'm trying to redirect after an ajax request doing something like that: 
String url = "" RequestCycle.get().urlFor(myPageInstance, IRedirectListener.INTERFACE );target.addJavascript( "window.location = '" +url+ "'" );
But always get an "Page Expired" error page.Is it possible to redirect to a page instance? Thanks, 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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Johan Compagner
need to see some more code or a test case.On 7/25/06, Paolo Di Tommaso <[EMAIL PROTECTED]> wrote:
I'm trying to redirect after an ajax request doing something like that: 
String url = "" RequestCycle.get().urlFor(myPageInstance, IRedirectListener.INTERFACE );target.addJavascript( "window.location = '" +url+ "'" );
But always get an "Page Expired" error page.Is it possible to redirect to a page instance? Thanks, Paolo
On 7/21/06, 
Johan Compagner <[EMAIL PROTECTED]> wrote:

maybe we should add urlFor(Page) to request cycle

whats wrong with:RequestCycle.get().urlFor(page,IRedirectListener.INTERFACE) ??johan



-Take Surveys. Earn Cash. Influence the Future of ITJoin 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.nethttps://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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-25 Thread Paolo Di Tommaso
I'm trying to redirect after an ajax request doing something like that: String url = "" RequestCycle.get().urlFor(myPageInstance, IRedirectListener.INTERFACE );target.addJavascript( "window.location = '" +url+ "'" );
But always get an "Page Expired" error page.Is it possible to redirect to a page instance? Thanks, PaoloOn 7/21/06, 
Johan Compagner <[EMAIL PROTECTED]> wrote:
maybe we should add urlFor(Page) to request cycle

whats wrong with:RequestCycle.get().urlFor(page,IRedirectListener.INTERFACE) ??johan


-
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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-22 Thread Paolo Di Tommaso
Igor you right when you say that generally is a contradiction having a page redirection on a ajax request but in the case of AjaxFormSubmitBehavior the request is to submit data, and common semantic for submit is "save data and proceed with next page in the flow".
Anyway I want to be more detailed about my use case: I have a complex form with a lot of fields with cross validation rules (some fields validation depends from other fields value). It's very common that users make a mistake filling out the form so I would avoid to have complete page render each time the user try to submit data. Only If there are no error on page I will go to the next page in the application flow.
So  AjaxFormSubmitBehavior is perfect for this use case. In onSubmit(target) method I check for any validation error, if any exists I will notify user about that with a _javascript_ alert  / 
target.addJavascript("alert('..')") /.If validation pass the form onSubmit will execute storing submitted data and proceeding to to next page / 
setResponsePage / .  I was a bit surprised to see that setResponsePage
 was not working in conjunction an AjaxFormSubmitBehavior  request. I think Eelco proposal to make AjaxRequestTarget translating page redirect to 
window.location is good idea. In this way setResponsePage semantic will be more uniform with both plain and ajax submit.Thanks. - Paolo But in my case, I'm using  
AjaxFormSubmitBehavior 
to validate and saving user data . On 7/21/06, Eelco Hillenius <
[EMAIL PROTECTED]> wrote:
I don't know whether it is that uncommon. Now that I think of it, Ican 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 youwant to redirect to a page there?EelcoOn 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 mai

Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-21 Thread Johan Compagner
hmm i find this:RequstCycle.get().urlFor(null, MyPage.class)almost just as ugly..to use...So just hide in in the AjaxThingie...johan
On 7/21/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
It's internal. IRedirectListener is not a typical thing to expose, andneither is urlFor. So if redirecting is really a corner case, this isfine. But maybe it isn't such a corner case after all, in which casewe should provide a little bit nicer API.
Eelco> whats wrong with:>> RequestCycle.get().urlFor(page,IRedirectListener.INTERFACE)>> ??>> johan -
> 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 ITJoin SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cashhttp://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___Wicket-user mailing listWicket-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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-21 Thread Eelco Hillenius
It's internal. IRedirectListener is not a typical thing to expose, and
neither is urlFor. So if redirecting is really a corner case, this is
fine. But maybe it isn't such a corner case after all, in which case
we should provide a little bit nicer API.

Eelco



> whats wrong with:
>
> RequestCycle.get().urlFor(page,IRedirectListener.INTERFACE)
>
> ??
>
> johan
>
>
>
> -
> 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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-21 Thread Johan Compagner
maybe we should add urlFor(Page) to request cycle
whats wrong with:RequestCycle.get().urlFor(page,IRedirectListener.INTERFACE) ??johan
-
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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-21 Thread Eelco Hillenius
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

Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-21 Thread Igor Vaynberg
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 :)
-IgorOn 7/21/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
Could we make AjaxRequestTarget a bit smarter so that it would have asetResponsePage method that translates to window.location= instead ofthe redirect we do for normal requests?EelcoOn 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 ITJoin SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cashhttp://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___Wicket-user mailing listWicket-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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-21 Thread Eelco Hillenius
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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-21 Thread Paolo Di Tommaso
This is the first delusion that Wicket got to me  ... :(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
-
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


Re: [Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-21 Thread Igor Vaynberg
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-IgorOn 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 ITJoin 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.nethttps://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


[Wicket-user] Problem response page using AjaxFormSubmitBehavior

2006-07-21 Thread Paolo Di Tommaso
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