How to get request/page parameters from RequestCycle?

2015-01-19 Thread Daniel Stoch
Hi, In Wicket 1.4 I can get a page parameter value using this code: PageParameters pageParameters = requestCycle.getPageParameters(); String value = pageParameters.getString(paramName); The problem is that in Wicket 6 there is no equivalent. I have tried with this solution:

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Daniel Stoch
Well this workaround from my previous post does not work, because this page does not exists yet when I need to get this parameter value. -- Daniel On Mon, Jan 19, 2015 at 4:16 PM, Daniel Stoch daniel.st...@gmail.com wrote: Maybe such workaround (not very elegant though): app.init():

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Daniel Stoch
On Mon, Jan 19, 2015 at 4:54 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, On Mon, Jan 19, 2015 at 4:38 PM, Daniel Stoch daniel.st...@gmail.com wrote: Hi, In Wicket 1.4 I can get a page parameter value using this code: PageParameters pageParameters =

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Daniel Stoch
Sorry, my fault - I forgot to pass a parameter. So: requestCycle.getRequest().getUrl() returns full path including mountpath and parameters, eg.: somepath/param1/value1 But if I pass this to UrlPathPageParametersEncoder.decodePageParameters() this decodes somepath as a first argument. On Mon,

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Daniel Stoch
Maybe such workaround (not very elegant though): app.init(): getRequestCycleListeners().add(new PageRequestHandlerTracker()); private Page getCurrentPage(RequestCycle requestCycle) { IPageRequestHandler pageRequestHandler = PageRequestHandlerTracker.getLastHandler(requestCycle); if

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Martin Grigorov
Hi, On Mon, Jan 19, 2015 at 4:38 PM, Daniel Stoch daniel.st...@gmail.com wrote: Hi, In Wicket 1.4 I can get a page parameter value using this code: PageParameters pageParameters = requestCycle.getPageParameters(); String value = pageParameters.getString(paramName); The problem

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Daniel Stoch
requestCycle.getRequest().getUrl() return null for me. - sorry, not null but returns only a mount path without paramname/paramvalue part. On Mon, Jan 19, 2015 at 5:09 PM, Daniel Stoch daniel.st...@gmail.com wrote: On Mon, Jan 19, 2015 at 4:54 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi,

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Martin Grigorov
On Mon, Jan 19, 2015 at 6:09 PM, Daniel Stoch daniel.st...@gmail.com wrote: On Mon, Jan 19, 2015 at 4:54 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, On Mon, Jan 19, 2015 at 4:38 PM, Daniel Stoch daniel.st...@gmail.com wrote: Hi, In Wicket 1.4 I can get a page parameter

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Daniel Stoch
This code is called inside custom DefaultMapperContext.newPageInstance() implementation and in custom IRequestMapper.mapRequest() method. -- Daniel On Mon, Jan 19, 2015 at 5:22 PM, Martin Grigorov mgrigo...@apache.org wrote: In what context do you need to extract these parameters ? In what

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Martin Grigorov
In what context do you need to extract these parameters ? In what class is this code ? Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Jan 19, 2015 at 6:20 PM, Daniel Stoch daniel.st...@gmail.com wrote: Sorry, my fault - I forgot to pass a parameter. So:

Re: How to get request/page parameters from RequestCycle?

2015-01-19 Thread Daniel Stoch
I have found another solution: in my scenario I can get parameters from DefaultMapperContext. newPageInstance(). Thanks for your help and tips. -- Daniel On Mon, Jan 19, 2015 at 5:44 PM, Daniel Stoch daniel.st...@gmail.com wrote: This code is called inside custom

Re: Page constructor calls multiple time

2015-01-19 Thread hoosssein
thanks. I found that this class render a jQuery Header Item and when I remove that item, All problems solved. thanks everybody. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Page-constructor-calls-multiple-time-tp4668994p4669051.html Sent from the Users forum