You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Makundi <ma...@koodaripalvelut.com> on 2009/07/19 08:54:03 UTC

Redirect fails wicketTest in rc7 - is there a workaround?

1. click ajaxButton
2. redirect in button onSubmit
3. verify redirect in test <FAILS>

Is there a workaround? https://issues.apache.org/jira/browse/WICKET-2379

**
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirect fails wicketTest in rc7 - is there a workaround?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> Your button should just be an external like.

I need some logic there before redirecting.

> I don't think you are supposed to be redirecting to an
> external url per the wiki guidelines here

new RedirectRequestTarget("/path/to/legacyJspFile.jsp") is what I am using.

It is not relevant whether it is external or internal. The point is,
that the test fails but it does work in real world.

> If you need the button to submit to do some logic, you can add a
> call decorator to do your redirect with javascript e.g.

It must be conditional to the logic.

Anyways. The main point is: the redirect works, but the wickettester
test fails, i.e., there is a bug in wickettester.

**
Martin

> ----------------------------------------
>> Date: Sun, 19 Jul 2009 09:54:03 +0300
>> Subject: Redirect fails wicketTest in rc7 - is there a workaround?
>> From: martin.makundi@koodaripalvelut.com
>> To: users@wicket.apache.org
>>
>> 1. click ajaxButton
>> 2. redirect in button onSubmit
>> 3. verify redirect in test
>>
>> Is there a workaround? https://issues.apache.org/jira/browse/WICKET-2379
>>
>> **
>> Martin
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
> _________________________________________________________________
> Bing™ brings you maps, menus, and reviews organized in one place. Try it now.
> http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TXT_MLOGEN_Local_Local_Restaurants_1x1
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Redirect fails wicketTest in rc7 - is there a workaround?

Posted by Russell Simpkins <ru...@hotmail.com>.
Martin,
Your button should just be an external like. I don't think you are supposed to be redirecting to an external url per the wiki guidelines here http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html, its this text on the bottom of the page:
Note that if you just want to make standard anchor tag links to other pages, don't create a Link and use this method in the onClick() handler; instead use the ExternalLink class.
----------------------------------------
> Date: Sun, 19 Jul 2009 09:54:03 +0300
> Subject: Redirect fails wicketTest in rc7 - is there a workaround?
> From: martin.makundi@koodaripalvelut.com
> To: users@wicket.apache.org
>
> 1. click ajaxButton
> 2. redirect in button onSubmit
> 3. verify redirect in test 
>
> Is there a workaround? https://issues.apache.org/jira/browse/WICKET-2379
>
> **
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

_________________________________________________________________
Bing™ brings you maps, menus, and reviews organized in one place. Try it now.
http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TXT_MLOGEN_Local_Local_Restaurants_1x1
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Redirect fails wicketTest in rc7 - is there a workaround?

Posted by Russell Simpkins <ru...@hotmail.com>.
Martin,
If you need the button to submit to do some logic, you can add a call decorator to do your redirect with javascript e.g.

protected IAjaxCallDecorator getAjaxCallDecorator() {	return new AjaxCallDecorator() {		public CharSequence decorateScript(CharSequence script) {			return "document.location.href='http://testurl';" + script;		}	};}
----------------------------------------
> Date: Sun, 19 Jul 2009 09:54:03 +0300
> Subject: Redirect fails wicketTest in rc7 - is there a workaround?
> From: martin.makundi@koodaripalvelut.com
> To: users@wicket.apache.org
>
> 1. click ajaxButton
> 2. redirect in button onSubmit
> 3. verify redirect in test 
>
> Is there a workaround? https://issues.apache.org/jira/browse/WICKET-2379
>
> **
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

_________________________________________________________________
Windows Live™ Hotmail®: Search, add, and share the web’s latest sports videos. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_videos_072009&cat=sports
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org