[Solved] Set application state in iframe only


Links in wicket work by calling the urlFor method of the request cycle. This includes a URL renderer which all URLs are passed through when they are being generated.

If you:

  • Write a sub class for UrlRenderer to add your themePreview parameter to all urls if it was a parameter in the request
  • Write a sub class of RequestCycle and override the newUrlRenderer() to return your UrlRenderer.
  • Create your own implementation of IRequestCycleProvider to provide your custom RequestCycle
  • In your application class, in the init method, call setRequestCycleProvider passing your custom IRequestCycleProvider.

This way, if the themePreview parameter is present in a request, it will be automatically added to any URL that is generated and so will be present on any link within your iframe.

solved Set application state in iframe only