Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wicket 1.5 and obtaining a URL to page instance

What is to correct way in Wicket 1.5 to obtain URL to a page instance?

In Wicket 1.4.x this worked:

MyPage page = new MyPage(some, parameters);
getRequestCycle().urlFor(page).toString()

A bunch of different versions of urlFor() were removed from RequestCycle in Wicket 1.5, among these were urlFor(Page page) that I was using in Wicket 1.4.

like image 682
Juha Syrjälä Avatar asked Mar 06 '12 08:03

Juha Syrjälä


1 Answers

You need: org.apache.wicket.request.cycle.RequestCycle#urlFor(IRequestHandler).

cycle.urlFor(new RenderPageRequestHandler(new PageProvider(page)))

I'm not sure why this wasn't migrated. I guess because it is not used widely...

like image 130
martin-g Avatar answered Oct 21 '22 11:10

martin-g