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.
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With