Fixing IOnChangeListener components with wantOnSelectionChangedNotifications()==true:
The IOnChangeListener components which have wantOnSelectionChangedNotifications() set (question: why is this method not part of the IOnChangeListener interface?),
generate a listener callback url send back to Wicket using either:
a) a hidden field if the component is part of a form
b) by setting the window.location.href when clicked
Both these methods are problematic in a portlet context wherein the (base) callback url is encoded as portlet url.
For method a), the url stored in the hidden field is decoded by Wicket itself and bypasses the portal for decoding the embedded wicket url.
So, for this method not the generated portlet url needs to be stored in the hidden field but the wicket url used to generate the portlet url...
Luckily, the PortletRequestContext already saves the last encoded wicket url internally (for redirect checks mainly), so as long as no other portlet url is generated,
this internally stored wicket url can be retrieved back to be used as (base) callback url in the hidden field.
And, as in all current implementations (o.a.w.markup.html.form.Check, .CheckBox, .DropDownChoice, .Radio, .RadioChoice) the portlet url is generated just before in the same code block,
this solution can savely be used.
For method b) however, I don't have a solution yet
As already described above for the Wicket.Ajax.Request.get() problem, the only way to solve this is using a POST (form) solution.
But in this case it cannot done through an Ajax request but needs to be performed on the client main browser window.
So, to properly solve this, we need to provide or dynamically create a special/extra form!
I have only found 1 example in wicket-examples which uses method b): DatesPage.
For now I will "solve" the DatesPage example with a very minor change by moving its LocaleDropDownChoice component inside a new "localeForm" , thereby switching it to use method a).
A real solution for method b) still needs to be found, but how to do that needs some discussion first.