On Thu, Sep 16, 2010 at 11:30 AM, Peter Karich <[email protected]> wrote:
> Hi,
>
> two questions:
>
> 1. If I do the following all url parameters will be replaced with
> ?wicket:interface=:6:1:::
>
> e.g. in the main wicket application class I do:
> mount(new MixedParamUrlCodingStrategy("search", HomePage.class, new
> String[]{"q"}));
>
> in HomePage.java i do without ajax:
> add(new Link("nextPage") {
> public void onClick() {
> // update some components
> }});
>
> How can I avoid that search?q=test which correctly appears after a
> search [1], will be overwritten with search?wicket:interface=:6:1::: ?
> I would like that the user can copy and paste the url to a friend and he
> can use the search (of course a new session is created + some parameters
> lost but the q parameter is ok). So why not:
> search?wicket:interface=:6:1:::&q=test
>
> The answer here is to use HybridUCS. It preserves the 'nice' url.
Or use Wicket 1.5 (M2.1). There the URL handling is much easier.
>
> 2. How can I use the HybridUrlCodingStrategy?
> I am doing:
> mount(new HybridUrlCodingStrategy("search", HomePage.class, true)); and
> the problem is that searches containing hashes destroy the url or the
> encoding does not work properly. So it writes the following url:
>
> search/q/#wicket.2
> instead of
> search/q/%23wicket.4
>
> I searched through the code of that strategy but I think, that the
> strategy works ok (it calls encode() when adding to url).
> In the search form I am doing the appended code [1] and this works
> correctly for other strategies.
>
I'm not sure where is the problem here. I'll need to try it myself ...
Please create a ticket in Jira with a quickstart. Maybe it is a bug.
>
> Where could be my mistake? Wicket version: 1.4.9
>
> Regards,
> Peter.
>
>
>
> [1]
> Form form = new Form("searchform") {
> public void onSubmit() {
> PageParameters params = new PageParameters();
> if (query != null && !query.isEmpty())
> params.add("q", query);
>
> setResponsePage(HomePage.class, params);
> }};
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>