RobAu RobAu - 1 year ago 81
Ajax Question

Wicket and Wicket-select2 both use PageParameter 'q'. How to solve?

I have a set of

s for my page, one is
(for query). This allows for nice URLs like:


But when I have a
component on my page, it initializes the query for the select2 with the same value of the

This causes the select2 to return an empty list of options, while the user has not even select anything yet.

I know I can change the name of my PageParameters (unfortunately, some clients will have to change urls). Or I can override the methods in
that use the

I wondered if there is a better solution?

I also posted this question on the Wicket mailinglist, and was asked to create an issue:

Will post the answer when thats done :)

Answer Source

As pointed in this [1] answer you can use stateless mounting for this

In most recent 7.x version (not merged to master yet) you can use following code to change mapping

Select2MultiChoice<CategoryTranslation> c = new Select2MultiChoice<CategoryTranslation>("categories");

This most probably will be the final solution :)


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download