2010/8/24 Major Péter <majorpe...@sch.bme.hu>:
> Hi,
>
> see inline
>
>> Usually it is a component that returns false in isStateless or
>> generates a stateful listener interface URL.
>
> 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.
>
>>> when I try to hit the URL now:
>>> showuser/id/1234
>>> then I'm going to have indexed parameters and not named parameter with
>>> 'id' name. Q3: Why is that?
>>
>> Because it's not a named paramerer (by default). The URL in question
>> will have two indexed parameters. id and 1234.
>> Big problem in 1.4 was that there was no distinction between indexed
>> parameters (part of path) and named parameters (usually part query
>> string). So it was difficult to build URLs such as
>> showpage/13?sort=asc
>>
>> 1.5 fixes this by defining URL scheme like this:
>>
>> /page/mount/path/indexed-param0/indexed-param1?named1=value1&name2=value2
>>
>> Btw. you should be able to mount the url in question as
>> showuser/id/{user-id}
>> wicket should then make user-id a named parameter.
>
> well, I've tried this with this quickstart:
> http://aldaris.sch.bme.hu/quick.tar.gz
> , but this really didn't worked. Also on my bigger project I was seeing
> weird redirections:
> * the app is on / contextroot
> * the homepage could have parameters, but it's not mandatory
> * and it's mapped to /app/show and /app/show/id/{id} too
> now when I open / I get redirected to /app/show/id/{id}?3
> when I open /app/show/id/123 then I got redirected to
> /app/show/id/{id}/show/id/123?4
I don't think you can mount same page twice.
>
>> It is still the same page instance. Obviously in your case you take
>> the page parameters into account only in page constructor. So when you
>> later change the id value (but leave page id the same) nothing
>> changes.
>>
>> However if  you for example override page onBeforeRender() and call
>> getPageParameters() there the id parameter will have proper value.
>
> so people should move model bindings to onBeforeRender, or move to
> stateless pages to be able to do this? Can't you store that page id
> somewhere else?
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.
>
>>> 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.

-Matej
>
> Thank you,
> 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