2010/8/24 Major Péter <majorpe...@sch.bme.hu>:
>>> okay, but how did the 1.4 have nice url in browser bar and Ajax working
>>> without this tweak? I mean this new ?number style urls are a bit ugly
>>> IMHO, and I have many ajaxified pages, so I don't know how to deal with
>>> this right now..
>> If you use regular bookmarkable pages in 1.4  with Ajax and refresh
>> the page then all your Ajax state is gone! This is why URLS are hybrid
>> by default in 1.5.
>
> I don't mind that, is there a way to change the default?
I don't think there is simple way to do that (unless you tweak the mapper).
Why would you want to do that though? All bookmarkable URLs are
generated without the page Id,
The redirect is temporary (so google indexes the original URL). URL is
still bookmarkable so users can copy and paste it, page Id is pretty
much harmless.

>
>> I don't think you can mount same page twice.
>
> Okay, how can I create aliases for a page then? And how could I create a
> nice url for parameterless and 'parameterful' pages? like /show shows a
> user own profile, and /show/id/{id} shows another users profile?
You can't mount the page twice, because in that case wicket will not
know which mapping to use for the page when generating the URL.
If you need page to be accessible on both
/show
and
/show/id/4

then you need to mount it on /show and treat /id/3 as indexed parameters.

>> Huh? Why should we store it somewhere else? It's part of page
>> parameters. Page parameters are current page parameters for the
>> requests. You can use models properly and reload the data on every
>> request (by quering getPageParameters().getNamedParameter("user-id")
>> for the id.
>
> I don't think you're using http referers to find out which page did the
> request came from, I think you're using the browser bar URL when you
> create the links for the page content. So the links on the page are
> already containing the page id's, that's great. But the browser bar URL
> is not used for anything after page rendering, or?
Http refereres? Where did that come from?

As I said, every time you call getPageParameters() it contains the
*current* URL parameters. It might be different from the
PageParameters that you got in page constructor, because that was
during page construction only.

so if you have an entity to show, best way is to use LDM
i.e.
new LoadableDetachableModel() {
    public Object load() {
       return userdao.load(getPageParameters().getNamedParameter("user-id"));
    }
}

This will result of the correct entity loaded even if you change page
parameters (while leaving the original page id).

-Matej
>
>>>>> Also how could I make Wicket to use by default the /id/1234 format
>>>>> instead of ?3&id=1234 for link creation??
>>>>
>>>> You can either set id and 1234 as indexed parameters or mount the page
>>>> as /showuser/id/{user-id}
>>>
>>> Probably my code is guilty, can you go through my quickstart?
>> You didn't put any code in the archive, just class files.
>
> doh, right.. The working url is http://aldaris.sch.bme.hu/myproject.tar.gz
> Just execute a mvn jetty:run and see how it 'works'.
>
> Thanks,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to