Re: constructing page multiple times per request

2013-01-21 Thread kamiseq
I did, I dont see anything specific about this

java.lang.RuntimeException: test
at com.myapp.Page1.initialize(Page1.java:80)
at com.myapp.Page1.init(Page1.java:48)
at com.myapp.Page1.init(Page1.java:42)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:174)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:66)
at
org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:133)
at
org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:278)
at
org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
at
org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
at
org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:94)
at
org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:244)
at
org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:830)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:365)
at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
at
org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:722)

and it is always 3 times ;/


pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 21 January 2013 09:19, Martin Grigorov mgrigo...@apache.org wrote:

 Hi,

 Just put a breakpoint in your constructor and see what are the stacktraces.


 On Sun, Jan 20, 2013 at 6:27 PM, kamiseq kami...@gmail.com wrote:

  hi,
  I try to understand why wicket (in 6th version) is constructing my page
  always 3 times per every request. it is page constructor is called 3
 times
  always I navigate to page.
 
  I configured it as
 
  getResourceSettings().setFileCleaner(null);
  getPageSettings().setVersionPagesByDefault(false);
 
 
 getRequestCycleSettings().setRenderStrategy

Re: constructing page multiple times per request

2013-01-21 Thread kamiseq
I have something like this in logs, I will try remove it


pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 21 January 2013 20:12, Ernesto Reinaldo Barreiro reier...@gmail.comwrote:

 Wasn't there some problem with empty images (img src= ) and IE
 reloading the page? At least I remember some old threads on this topic.

 On Mon, Jan 21, 2013 at 8:07 PM, kamiseq kami...@gmail.com wrote:

  I did, I dont see anything specific about this
 
  java.lang.RuntimeException: test
  at com.myapp.Page1.initialize(Page1.java:80)
  at com.myapp.Page1.init(Page1.java:48)
  at com.myapp.Page1.init(Page1.java:42)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
  Method)
  at
 
 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at
 
 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
  at
 
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:174)
  at
 
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:66)
  at
 
 
 org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:133)
  at
 
 
 org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:278)
  at
 
 
 org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
  at
 
 
 org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
  at
 
 
 org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:94)
  at
 
 
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:244)
  at
 
 
 org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:830)
  at
 
 
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
  at
 
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
  at
 
 
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
  at
 
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
  at
 
 
 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
  at
 
 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
  at
 
 
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
  at
 
 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
  at
 
 
 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
  at
 
 
 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
  at
  org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
  at
 
 
 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
  at
 
 
 org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
  at
 
 
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
  at
 
 
 org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
  at
 
 
 org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
  at
 
 
 org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
  at org.eclipse.jetty.server.Server.handle(Server.java:365)
  at
 
 
 org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
  at
 
 
 org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
  at
 
 
 org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
  at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
  at
  org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
  at
 
 
 org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
  at
 
 
 org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
  at
 
 
 org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
  at
 
 
 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
  at
 
 
 org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
  at java.lang.Thread.run(Thread.java:722

Re: constructing page multiple times per request

2013-01-21 Thread kamiseq
yep that was it, why this happens?

thanks ernesto, it is not only on IE ;] firefox also


pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 21 January 2013 20:36, kamiseq kami...@gmail.com wrote:

 I have something like this in logs, I will try remove it


 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __


 On 21 January 2013 20:12, Ernesto Reinaldo Barreiro reier...@gmail.comwrote:

 Wasn't there some problem with empty images (img src= ) and IE
 reloading the page? At least I remember some old threads on this topic.

 On Mon, Jan 21, 2013 at 8:07 PM, kamiseq kami...@gmail.com wrote:

  I did, I dont see anything specific about this
 
  java.lang.RuntimeException: test
  at com.myapp.Page1.initialize(Page1.java:80)
  at com.myapp.Page1.init(Page1.java:48)
  at com.myapp.Page1.init(Page1.java:42)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
  Method)
  at
 
 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at
 
 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
  at
 
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:174)
  at
 
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:66)
  at
 
 
 org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:133)
  at
 
 
 org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:278)
  at
 
 
 org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
  at
 
 
 org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
  at
 
 
 org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:94)
  at
 
 
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:244)
  at
 
 
 org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:830)
  at
 
 
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
  at
 
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
  at
 
 
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
  at
 
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
  at
 
 
 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
  at
 
 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
  at
 
 
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
  at
 
 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
  at
 
 
 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
  at
 
 
 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
  at
 
 org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
  at
 
 
 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
  at
 
 
 org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
  at
 
 
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
  at
 
 
 org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
  at
 
 
 org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
  at
 
 
 org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
  at org.eclipse.jetty.server.Server.handle(Server.java:365)
  at
 
 
 org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
  at
 
 
 org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
  at
 
 
 org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
  at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
  at
  org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
  at
 
 
 org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
  at
 
 
 org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
  at
 
 
 org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run

Re: constructing page multiple times per request

2013-01-21 Thread kamiseq
ok, thanks anyway, indeed it was killing me for some time now ;]


pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 21 January 2013 21:13, Ernesto Reinaldo Barreiro reier...@gmail.comwrote:

 Hi,

 On Mon, Jan 21, 2013 at 8:42 PM, kamiseq kami...@gmail.com wrote:

  yep that was it, why this happens?
 

 To be honest I do not know the exact reason...  I guess a second request is
 launched to retrieve  missing empty image... Just googled for it and
 found this.


 http://www.nczonline.net/blog/2009/11/30/empty-image-src-can-destroy-your-site/


 
  thanks ernesto, it is not only on IE ;] firefox also
 
 
  pozdrawiam
  Paweł Kamiński
 
  kami...@gmail.com
  pkaminski@gmail.com
  __
 
 
  On 21 January 2013 20:36, kamiseq kami...@gmail.com wrote:
 
   I have something like this in logs, I will try remove it
  
  
   pozdrawiam
   Paweł Kamiński
  
   kami...@gmail.com
   pkaminski@gmail.com
   __
  
  
   On 21 January 2013 20:12, Ernesto Reinaldo Barreiro 
 reier...@gmail.com
  wrote:
  
   Wasn't there some problem with empty images (img src= ) and IE
   reloading the page? At least I remember some old threads on this
 topic.
  
   On Mon, Jan 21, 2013 at 8:07 PM, kamiseq kami...@gmail.com wrote:
  
I did, I dont see anything specific about this
   
java.lang.RuntimeException: test
at com.myapp.Page1.initialize(Page1.java:80)
at com.myapp.Page1.init(Page1.java:48)
at com.myapp.Page1.init(Page1.java:42)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
   
   
  
 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
   
   
  
 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at
 java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at
   
   
  
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:174)
at
   
   
  
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:66)
at
   
   
  
 
 org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:133)
at
   
   
  
 
 org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:278)
at
   
   
  
 
 org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
at
   
   
  
 
 org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
at
   
   
  
 
 org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:94)
at
   
   
  
 
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:244)
at
   
   
  
 
 org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
at
   
   
  
 
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:830)
at
   
   
  
 
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
   
  
 
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
at
   
   
  
 
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
at
   
   
  
 
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
at
   
   
  
 
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at
   
   
  
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
at
   
   
  
 
 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
at
   
  
 
 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
at
   
   
  
 
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at
   
  
 
 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
at
   
   
  
 
 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at
   
   
  
 
 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
at
   
  
  org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
at
   
   
  
 
 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at
   
   
  
 
 org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
at
   
   
  
 
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at
   
   
  
 
 org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
at
   
   
  
 
 org.eclipse.jetty.server.handler.HandlerCollection.handle

Re: wicket 6 setting response page with page object and session expired error

2012-05-22 Thread kamiseq
huh, then something is wrong with my environment,
im running it with jetty invoking simple mvn clean install jetty:run

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: wicket 6 setting response page with page object and session expired error

2012-05-22 Thread kamiseq
anyway there is nothing wrong to my code, in your opnion?
I just have bad feeling about passing model from one page to another
in constructor. on the other hand model are serialised into session so
maybe it is a better idea to pass them around rather than object they
are wrapping

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 22 May 2012 18:13, kamiseq kami...@gmail.com wrote:
 huh, then something is wrong with my environment,
 im running it with jetty invoking simple mvn clean install jetty:run

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

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



Re: wicket 6 setting response page with page object and session expired error

2012-05-22 Thread kamiseq
but why??
test it with mvn clean install jetty:run

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 22 May 2012 20:47, Thomas Götz t...@decoded.de wrote:
 I tested your quickstart from within the IDE by running Start.java.

 Models are meant to be passed around, so there's nothing wrong with it in 
 general. And it's always (at least in 95% of cases I'd dare to say) 
 preferable to passing Objects (beans).


   -Tom


 On 22.05.2012 at 18:55 kamiseq wrote:

 anyway there is nothing wrong to my code, in your opnion?
 I just have bad feeling about passing model from one page to another
 in constructor. on the other hand model are serialised into session so
 maybe it is a better idea to pass them around rather than object they
 are wrapping

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __


 On 22 May 2012 18:13, kamiseq kami...@gmail.com wrote:
 huh, then something is wrong with my environment,
 im running it with jetty invoking simple mvn clean install jetty:run

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

 -
 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


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



Re: wicket 6 setting response page with page object and session expired error

2012-05-22 Thread kamiseq
i checked it on other machine, and is working, I ve cleaned m2
repository and now it is working as well :/
I dont know what happened but it is weird that it showed on two
separate application

thanks for help, actually it is great it was only may problem ;]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 22 May 2012 22:52, kamiseq kami...@gmail.com wrote:
 but why??
 test it with mvn clean install jetty:run

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __


 On 22 May 2012 20:47, Thomas Götz t...@decoded.de wrote:
 I tested your quickstart from within the IDE by running Start.java.

 Models are meant to be passed around, so there's nothing wrong with it in 
 general. And it's always (at least in 95% of cases I'd dare to say) 
 preferable to passing Objects (beans).


   -Tom


 On 22.05.2012 at 18:55 kamiseq wrote:

 anyway there is nothing wrong to my code, in your opnion?
 I just have bad feeling about passing model from one page to another
 in constructor. on the other hand model are serialised into session so
 maybe it is a better idea to pass them around rather than object they
 are wrapping

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __


 On 22 May 2012 18:13, kamiseq kami...@gmail.com wrote:
 huh, then something is wrong with my environment,
 im running it with jetty invoking simple mvn clean install jetty:run

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

 -
 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


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



wicket 6 setting response page with page object and session expired error

2012-05-21 Thread kamiseq
hej,
I have a strange error.

I have stateless page (A) with form on it. form contains email input.
inside form's onSelect handler I create page (B) and pass email to its
constructor.
  Application nextPage = new
Application(getModelObject().getEmail());// form model object
  setResponsePage(nextPage);

page B is also mounted so someone can access page by passing email as parameter.
  super(parameters);
  StringValue email = parameters.get(email);
  if (email.isEmpty())
throw new RuntimeException(ups no email);

page B displays users data if available.
page B creates LoadableDetachableModel and uses email as id, I also
pass Injected service object by giuce to the model
page B has link to go to page C
add(new LinkVoid(accept)
{
@Override
public void onClick() {
SignIn signInPage = new SignIn(model); // model is created on
the begging of the constructor
setResponsePage(signInPage);
}
});

pages B and C are state-full.
now when I go from page A and pass page B object and then call the
link which creates page C object then I get page expired message.
BUT if I go directly to page B using mounted url and then I click on
link I am redirected to page C without a problem.

maybe I miss something obvious here but I cannot explain it why this
is happening.
there is no errors in log from wicket, the SignIn (C) page is created
as expected.

thanks for any hint.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: wicket 6 setting response page with page object and session expired error

2012-05-21 Thread kamiseq
yes,
can I send it directly to you in case userlist rejects attachment?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 21 May 2012 10:01, Thomas Götz t...@decoded.de wrote:
 Could you provide a quickstart that demonstrates this behavior?

   -Tom


 On 21.05.2012 at 09:56 kamiseq wrote:

 hej,
 I have a strange error.

 I have stateless page (A) with form on it. form contains email input.
 inside form's onSelect handler I create page (B) and pass email to its
 constructor.
  Application nextPage = new
 Application(getModelObject().getEmail());// form model object
  setResponsePage(nextPage);

 page B is also mounted so someone can access page by passing email as 
 parameter.
  super(parameters);
  StringValue email = parameters.get(email);
  if (email.isEmpty())
    throw new RuntimeException(ups no email);

 page B displays users data if available.
 page B creates LoadableDetachableModel and uses email as id, I also
 pass Injected service object by giuce to the model
 page B has link to go to page C
 add(new LinkVoid(accept)
 {
    @Override
    public void onClick() {
        SignIn signInPage = new SignIn(model); // model is created on
 the begging of the constructor
        setResponsePage(signInPage);
    }
 });

 pages B and C are state-full.
 now when I go from page A and pass page B object and then call the
 link which creates page C object then I get page expired message.
 BUT if I go directly to page B using mounted url and then I click on
 link I am redirected to page C without a problem.

 maybe I miss something obvious here but I cannot explain it why this
 is happening.
 there is no errors in log from wicket, the SignIn (C) page is created
 as expected.

 thanks for any hint.

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

 -
 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


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



Re: wicket 6 setting response page with page object and session expired error

2012-05-21 Thread kamiseq
ok,
yep right, give me some time so I try to recreate it from scratch

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 21 May 2012 16:48, Thomas Götz t...@decoded.de wrote:
 Either this or upload it somewhere and post the link here.

   -Tom


 On 21.05.2012 at 16:25 kamiseq wrote:

 yes,
 can I send it directly to you in case userlist rejects attachment?

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __


 -
 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



Re: wicket 6 resources

2012-05-19 Thread kamiseq
thanks, it works.

ok so if jQuery is added always as wicket depends on it now, so what
is JQueryPluginResourceReference for??? I saw it in
http://www.wicket-library.com/wicket-examples-6.0.x/resourceaggregation/
and javadoc says it is Base class for JavaScript resources that are
JQuery plugins but in example HomePage.js is not a jQ plugin. more,
it will work if I reference js file using
response.render(JavaScriptHeaderItem.forUrl(scripts/Forms.js)); (as
you showed me) or using JS reference to get file from java package.

im just little confused

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 19 May 2012 13:42, vineet semwal vineetsemwal1...@gmail.com wrote:
 On Sat, May 19, 2012 at 5:42 AM, kamiseq kami...@gmail.com wrote:
 hej,
 I tried to look for this and I ve found some old topics but they were
 related to older version of wicket than 6.

 I m looking for 2 things

 1] I would like to get validator message with all parameters. for
 example lets take required message I can get it like this: new
 StringResourceModel(Required, this, null).getString() but it will
 return Field '${label}' is required. or its translated equivalent.
 how can I set label parameter with actual value. maybe
 StringRecourceModel is not the best choice. I tried to look how
 validators do that but I think it is to much trouble.

 public class Foo implements Serializable {String label;public String
 getLabel() {return anyname;}    }
 new StringResourceModel(key,JsPage.this, new Model(new Foo())).toString()

 or you  can useinterpolator like mapvariableinterpolator
  MapString,Stringmap=new HashMapString, String();
     map.put(label,anyname);
    MapVariableInterpolator.interpolate( getString(key), map);

 I need this error message before form performs any validation so I can
 reuse it in javascript validation. in other words if form component
 has validator I would like to get its message and add it to my custom
 js validation function.

 2] I know that I should keep all my css and js next to java classes
 and let wicket handle, and this work - I have no problem with it. but
 sometimes it is more convenient to put those scripts inside webapp
 directory. and again I ve found some article about it but I dont want
 to use wro4j. what is the easiest way to reference any JS script from
 webapp/scripts/ in wicket 6?? I started playing with requireJs.js and
 it looks for scripts inside scripts directory

 i started with code like this
 response.render(JavaScriptHeaderItem.forReference(new
 JQueryPluginResourceReference(Application.class, Forms.js))); but of
 course it is not working.

  resourcereference is not required  to access resources in webcontext
 response.render(JavaScriptContentHeaderItem.forUrl(Forms.js));

 maybe Im too tired or something but all I can find uses resources
 inside java packages.

 thanks for any hints

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

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




 --
 thank you,

 regards,
 Vineet Semwal

 -
 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



Re: wicket 6 resources

2012-05-19 Thread kamiseq
ok but when you use JQueryPluginResourceReference how then access
scripts form webapp directory, I tried something like
JQueryPluginResourceReference(null, scripts/Form) and
JQueryPluginResourceReference(myPageRef, scripts/Form) but no luck,
maybe I just overlooked something

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 19 May 2012 23:44, vineet semwal vineetsemwal1...@gmail.com wrote:
 afaik wicket ajax depends on jquery and not whole wicket so jquery is
 not always imported in your page automatically,it's imported
 automatically when you your page has some wicket ajax functionality so
 imo if your js file  is using jquery  then you should use
 JQueryPluginResourceReference to import your js file
 ,JQueryPluginResourceReference will also add jquery on its own .
 basically this approach prevents version conflicts .

  btw HomePage.js is using jquery ..


 On Sat, May 19, 2012 at 11:23 PM, kamiseq kami...@gmail.com wrote:
 thanks, it works.

 ok so if jQuery is added always as wicket depends on it now, so what
 is JQueryPluginResourceReference for??? I saw it in
 http://www.wicket-library.com/wicket-examples-6.0.x/resourceaggregation/
 and javadoc says it is Base class for JavaScript resources that are
 JQuery plugins but in example HomePage.js is not a jQ plugin. more,
 it will work if I reference js file using
 response.render(JavaScriptHeaderItem.forUrl(scripts/Forms.js)); (as
 you showed me) or using JS reference to get file from java package.

 im just little confused

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __


 On 19 May 2012 13:42, vineet semwal vineetsemwal1...@gmail.com wrote:
 On Sat, May 19, 2012 at 5:42 AM, kamiseq kami...@gmail.com wrote:
 hej,
 I tried to look for this and I ve found some old topics but they were
 related to older version of wicket than 6.

 I m looking for 2 things

 1] I would like to get validator message with all parameters. for
 example lets take required message I can get it like this: new
 StringResourceModel(Required, this, null).getString() but it will
 return Field '${label}' is required. or its translated equivalent.
 how can I set label parameter with actual value. maybe
 StringRecourceModel is not the best choice. I tried to look how
 validators do that but I think it is to much trouble.

 public class Foo implements Serializable {String label;public String
 getLabel() {return anyname;}    }
 new StringResourceModel(key,JsPage.this, new Model(new Foo())).toString()

 or you  can useinterpolator like mapvariableinterpolator
  MapString,Stringmap=new HashMapString, String();
     map.put(label,anyname);
    MapVariableInterpolator.interpolate( getString(key), map);

 I need this error message before form performs any validation so I can
 reuse it in javascript validation. in other words if form component
 has validator I would like to get its message and add it to my custom
 js validation function.

 2] I know that I should keep all my css and js next to java classes
 and let wicket handle, and this work - I have no problem with it. but
 sometimes it is more convenient to put those scripts inside webapp
 directory. and again I ve found some article about it but I dont want
 to use wro4j. what is the easiest way to reference any JS script from
 webapp/scripts/ in wicket 6?? I started playing with requireJs.js and
 it looks for scripts inside scripts directory

 i started with code like this
 response.render(JavaScriptHeaderItem.forReference(new
 JQueryPluginResourceReference(Application.class, Forms.js))); but of
 course it is not working.

  resourcereference is not required  to access resources in webcontext
 response.render(JavaScriptContentHeaderItem.forUrl(Forms.js));

 maybe Im too tired or something but all I can find uses resources
 inside java packages.

 thanks for any hints

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

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




 --
 thank you,

 regards,
 Vineet Semwal

 -
 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




 --
 thank you,

 regards,
 Vineet Semwal

 -
 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

Re: wicket 6 resources

2012-05-19 Thread kamiseq
hym, I thought it is more flexible, anyway I can always add jquery
manually. and yes good point that I need make sure that im using same
version of jQ as wicket.

thanks for explanation

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: wicket 6 resources

2012-05-19 Thread kamiseq
yep,
I think I ve even seen a way to change jQ file somewhere in
application settings. it was described somewhere in migration to 6.0
page

again thanks

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 20 May 2012 07:27, vineet semwal vineetsemwal1...@gmail.com wrote:
 you are welcome ..,to use same version of jquery in your case do
 response.render(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference()))

 On Sun, May 20, 2012 at 10:46 AM, kamiseq kami...@gmail.com wrote:
 hym, I thought it is more flexible, anyway I can always add jquery
 manually. and yes good point that I need make sure that im using same
 version of jQ as wicket.

 thanks for explanation

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

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




 --
 thank you,

 regards,
 Vineet Semwal

 -
 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



wicket 6 resources

2012-05-18 Thread kamiseq
hej,
I tried to look for this and I ve found some old topics but they were
related to older version of wicket than 6.

I m looking for 2 things

1] I would like to get validator message with all parameters. for
example lets take required message I can get it like this: new
StringResourceModel(Required, this, null).getString() but it will
return Field '${label}' is required. or its translated equivalent.
how can I set label parameter with actual value. maybe
StringRecourceModel is not the best choice. I tried to look how
validators do that but I think it is to much trouble.

I need this error message before form performs any validation so I can
reuse it in javascript validation. in other words if form component
has validator I would like to get its message and add it to my custom
js validation function.

2] I know that I should keep all my css and js next to java classes
and let wicket handle, and this work - I have no problem with it. but
sometimes it is more convenient to put those scripts inside webapp
directory. and again I ve found some article about it but I dont want
to use wro4j. what is the easiest way to reference any JS script from
webapp/scripts/ in wicket 6?? I started playing with requireJs.js and
it looks for scripts inside scripts directory

i started with code like this
response.render(JavaScriptHeaderItem.forReference(new
JQueryPluginResourceReference(Application.class, Forms.js))); but of
course it is not working.

maybe Im too tired or something but all I can find uses resources
inside java packages.

thanks for any hints

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: VTD XML for wicket

2012-05-17 Thread kamiseq
too bad

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 17 May 2012 11:12, Kees van Dieren i...@squins.com wrote:
 Its licenced GPL so wicket cannot depend on it.


 Best regards / Met vriendelijke groet,

 Kees van Dieren
 Squins | IT, Honestly
 Oranjestraat 23
 2983 HL Ridderkerk
 The Netherlands
 Phone: +31 (0)180 415559
 Mobile: +31 (0)6 30413841
 www.squins.com
 http://twitter.com/keesvandieren
 Chamber of commerce Rotterdam: 24435130
 Boeken voor school en werk bestel je op studieboekencenter.nl
 2012/5/17 kamiseq kami...@gmail.com

 anyway VDT-XML outperforms any existing SAXlike or DOM technologies. I
 just want to let you know.

 take care

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __


 On 17 May 2012 07:08, Igor Vaynberg igor.vaynb...@gmail.com wrote:
  xml is parsed only the first time a page/panel is accessed. broken
  down into a collection of chunks optimized for wicket's consumption.
  and cached.
 
  -igor
 
  On Wed, May 16, 2012 at 9:49 PM, kamiseq kami...@gmail.com wrote:
  hej,
  have you ever consider using http://vtd-xml.sourceforge.net/ as xml
  parsing library??
  I ve already successfully used this in quite big project and for sure
  it is worth checking as I suspect wicket spends some time parsing html
  on each request, right?
 
  pozdrawiam
  Paweł Kamiński
 
  kami...@gmail.com
  pkaminski@gmail.com
  __
 
  -
  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
 

 -
 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



Re: VTD XML for wicket

2012-05-16 Thread kamiseq
anyway VDT-XML outperforms any existing SAXlike or DOM technologies. I
just want to let you know.

take care

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 17 May 2012 07:08, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 xml is parsed only the first time a page/panel is accessed. broken
 down into a collection of chunks optimized for wicket's consumption.
 and cached.

 -igor

 On Wed, May 16, 2012 at 9:49 PM, kamiseq kami...@gmail.com wrote:
 hej,
 have you ever consider using http://vtd-xml.sourceforge.net/ as xml
 parsing library??
 I ve already successfully used this in quite big project and for sure
 it is worth checking as I suspect wicket spends some time parsing html
 on each request, right?

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

 -
 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


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



Re: wicket 6 global services

2012-05-15 Thread kamiseq
ok,
thanks

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 15 May 2012 08:43, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 See http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources
 Instead of serving images you can serve whatever you need.

 On Tue, May 15, 2012 at 1:19 AM, kamiseq kami...@gmail.com wrote:
 hej,
 I have few questions about how to do few things in wicket, right now I
 m focusing on 6th version.

 I would like to create global service that returns for example JSON or
 html. and given I have stateless page with components that supports
 AJAX I would like to point my JS components to this global service.

 I think it best to accomplish this with mounting
 1) mount resource and then use
 getRequestCycle().urlFor(resourceReference, parameters);
 2) if I have to return html maybe it is better to mount page

 I ve also found somewhere that I could implement custom renderers that
 could render simple html or jason or whatever text I need, but I
 cannot find anything about right now.

 what about adding custom RequestCycleListener, or something like that?

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

 -
 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



Re: wicket 6 dynamic form parts generated in JS

2012-05-15 Thread kamiseq
ok, great.
this is what I thought so I dont want to reinvent things again, many
thanks for quick replay

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: wicket 6 using external session

2012-05-15 Thread kamiseq
the other technology is WebObjects and it uses its own server, I have
no idea if it can be easily ported to servlet container, anyway right
now it is not using one (as far I can tell).

 Wicket stores only the last used page instance in the http session.
 One instance!
 And only if the page is stateful.
 With a custom IPageStore impl you can make this even 0, but then each
 Ajax request will load the page from the disk.

maybe it is possible to make a hybrid implementation to store model
data in shared session and everything else locally because only wicket
will use it. where should I start digging.
IPageStore is one anything else?

what about rendering strategies - is this something I should worry about?

thanks

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: Aggregating JavaScript

2012-05-14 Thread kamiseq
I was thinking about creating custom behaviour that will connect to other
behaviour and render all scripts needed at the bottom of the page (If this
is possible),
I understand that headerContributior is not good choice as it will render
scripts in head section and we want them at the bottom

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 27 April 2012 09:46, Martin Grigorov mgrigo...@apache.org wrote:

 Hi,

 I think there are two options:
 1) use a IMarkupFilter that will extract the scripts from the markup and
 transform them to header contributions via ComponentTag#addBehavior()
 2) wicket:head has a non-documented attribute called wicket:scope that
 may help here. I haven't used it (otherwise I'd document it) and I'm not
 quite sure whether it will do the job

 On Thu, Apr 26, 2012 at 7:05 PM, Ashoka Upadhya aupad...@art.com wrote:

  I would like to aggregate all javascript and move to the bottom of the
  page. I looked into the resource aggregation example and also filtering
  header response. If I understand correctly header response filter methods
  are called only when the scripts are added explicitly through
  IHeaderResponse methods (renderJavaSCriptReference ..etc)
 
  ** **
 
  In our case, scripts are added in the markup (these markups are defined
 in
  the CMS). Is there a way to collect all scripts from the markup and also
  added through IHeaderResponse?
 
  ** **
 
  Regards, 
 
   
 
  Ashoka Upadhya 
 
  Principal Software Engineer
 
  Art.com
 
  Phone: (510) 879-4858
 
  Fax: (510) 588-3930
 
  [image: art.com, inc]
 
   
 
  ** **
 
  [image: art.com] http://www.art.com/
 
  [image: allposters.com] http://www.allposters.com/
 
  [image: artist] http://www.artistrising.com/
 
  If you have received this e-mail in error, please immediately notify the
  sender by reply e-mail and destroy the original e-mail and its
 attachments
  without reading or saving them. This e-mail and any documents, files or
  previous e-mail messages attached to it, may contain confidential or
  privileged information that is prohibited from disclosure under
  confidentiality agreement or applicable law. If you are not the intended
  recipient, or a person responsible for delivering it to the intended
  recipient, you are hereby notified that any disclosure, copying,
  distribution or use of this e-mail or any of the information contained in
  or attached to this e-mail is STRICTLY PROHIBITED. Thank you.
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/



wicket 6 global services

2012-05-14 Thread kamiseq
hej,
I have few questions about how to do few things in wicket, right now I
m focusing on 6th version.

I would like to create global service that returns for example JSON or
html. and given I have stateless page with components that supports
AJAX I would like to point my JS components to this global service.

I think it best to accomplish this with mounting
1) mount resource and then use
getRequestCycle().urlFor(resourceReference, parameters);
2) if I have to return html maybe it is better to mount page

I ve also found somewhere that I could implement custom renderers that
could render simple html or jason or whatever text I need, but I
cannot find anything about right now.

what about adding custom RequestCycleListener, or something like that?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



wicket 6 dynamic form parts generated in JS

2012-05-14 Thread kamiseq
hej,
I would like to dynamically add same part to form, let say I have a
form that has a section with 3 inputs : start, end and name. those
section can occur many times depending on model.

this is very easy when depending on server logic and making full page
refresh every time users add section via link.
I would like to add such section from javascript, without server
interaction. the problem I see is that I need to generate names of
inputs in section witch will contain the right index so wicket knows
where to put data, right?

example

form
  ol
li wicket:id=each.section
   div wicket:id=form.part/div
/li
  /ol
/form
I created custom FormComponentPanel and overridden convertInput. and
added ListView to create list with panels.
when I looked on generated html, names of input where something like :
name=each.section:1:form.part:start, so I guess I could generate
something like that in JS but I wonder if this will not break wicket
logic. more even I hack those names creating elements in JS list will
not be synchronised with model on server and they will be removed when
user refreshes the page

I think the best way to do it is to make a round trip to server with
ajax and replace form content every time user clicks a button.

what do you think?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



wicket 6 using external session

2012-05-14 Thread kamiseq
hej,
I need to handle 2 frameworks in the same time (one with legacy
application and wicket application that will handle pieces of old
functionality and new features - at least for some time until
everything is rewritten to wicket app) - maybe Im wrong here but this
means I need to share session between those to frameworks. has anyone
done something like that.

I thinking of using some key-value database that scales well or some
centralised custom rest service.
any thoughts on implementation provided that wicket stores a lot in
session, what about rendering to buffer and so on.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: rough estimate of when wicket 1.6 will be released?

2012-03-13 Thread kamiseq
by 1.6 you mean 6, right?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: Securing Resource in Web Context

2012-03-07 Thread kamiseq
can't you put your resources to DB ?? then you will have quick access and
it will be secure?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: JavaFX2 and Wicket

2012-02-24 Thread kamiseq
those are totally two different technologies. wicekt can generate you html
and you can embed flash or javafx applet there. I doubt there is any
integration between wicket and flash or java fx.

look at javafx tutorial first (they create html file there) and then learn
how you can create such page in wicket

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: call a javascript

2012-02-10 Thread kamiseq
check wicket.ajax and its method getAjax or something like that.

if you use AjaxEventBehavior then the ajax callback (which uses that js
getAjax method) is already coded for you.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: Tighter Wicket-Spring integration

2012-02-06 Thread kamiseq
also you need to consider that wicket components will be accessed from
different threads

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: Stateless and Ajax

2012-01-31 Thread kamiseq
I dont know if the conversation you pointed to can explain anything
for this question;]

I can only guess that if you make ajax call and you already have page
created then it is faster, from what I know solution like jolira
creates new page and whole component tree over and over again on each
ajax call.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: Stateless and Ajax

2012-01-31 Thread kamiseq
;] hurray

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: handling request to component - the wicket way

2012-01-27 Thread kamiseq
ok, thanks I ll look at it during weekend

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: Problems with requests to MountPath and optional parameters

2012-01-26 Thread kamiseq
maybe try date as milseconds (as long)?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: handling request to component - the wicket way

2012-01-26 Thread kamiseq
1.5.4 why?
if you have any resources I ve overlooked it d be great if you can share them:]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: guestbook application with database update

2012-01-21 Thread kamiseq
it really doesnt matter where you get your data - from ArrayList or db
- wrap code to access db into some function that return List and use
LoadableDetachableModel as sven advised

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: wicket appl architecture

2012-01-19 Thread kamiseq
well but then you need to rewrite some logic you already have in
wicket's components, right?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



redirecting, cookies, render mode and testing

2012-01-10 Thread kamiseq
hej,
maybe Im still confusing basics concepts but this is quite new stuff.

recently I had few problems with redirecting after setting cookies (my
application was setup to use render-to-buffer default strategy).
simple setResponsePage is not good enough as cookies are lost then I
was advised to use ReplaceHandlerException and rewrite response
actions (like setting cookies) from response to original response.
private void rewriteResponseActions()
{
final RequestCycle cycle = RequestCycle.get();
Response response = cycle.getResponse();
Response originalResponse = cycle.getOriginalResponse();
//it only makes sense for IMetaDataBufferingWebResponse
//in tests originalResponse is same as response
if (originalResponse != response  response instanceof
IMetaDataBufferingWebResponse)
{
IMetaDataBufferingWebResponse bufferingWebResponse =
(IMetaDataBufferingWebResponse) response;
bufferingWebResponse.writeMetaData((WebResponse) originalResponse);
}
}
this works fine, redirect is not scheduled and is immediately performed.

there is one but however!
setting my application to use one-pass-render strategy breaks url
rendering. the app is redirected correctly but url is as it was before
redirecting.
I was investigating that and it seems it is because in
WebPageRenderer#respond(RequestCycle requestCycle) currentUrl (the one
from before redirection) is used instead of targetUrl (the one where
we want redirect to)

if (isOnePassRender()  isAjax == false  getRedirectPolicy() !=
RedirectPolicy.ALWAYS_REDIRECT)
then
BufferedWebResponse response = renderPage(currentUrl, requestCycle);
// but new requestHandler (the one from replace handler exception) is
used

now probably I should pass ALWAYS_REDIRECT instead of AUTO_REDIRECT to
just created ReplaceHandlerException and it would fix all my problems
but I didnt.
I decided that I will go back to setResponsePage and reuse
rewiriteResponseActions just before redirection. And it all works fine
(yeah I really dont need immediate redirection), cookies are
persisted. So why this is not part of default behaviour?

the other thing is that wicket tester uses totally different logic and
it always passes my redirect tests no matter which redirection method
I choose (setResponsePage or throw ReplaceHandlerException) as
cycle.getResponse() and cycle.getOriginalResponse() returns the same
object and cookies are already there.

If this is WAD then OK but maybe it could be described better somewhere.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: stateless, not versioned pages - session problem

2012-01-09 Thread kamiseq
this should go to separate conversation

I created stateless (no stateful components) page if user is
authorized i put his id to session so I can load it on each page
creation (since it is stateless and not versioned it will be created
on each request)

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__



On 9 January 2012 12:39, Chris Colman chr...@stepaheadsoftware.com wrote:
 The stateless/stateful issue, on the surface at least, seems to be trivially 
 easy because it's so black and white. Obviously in an ideal world most pages 
 should be made stateless but in all but trivial sites this is near 
 impossible. I'd like to suggest there is a fair amount of 'gray' - that 
 things aren't so 'black and white' in the real world.

 For example - the content on most of the pages on our sites are essentially 
 stateless - showing product details or FAQ pages or About Us pages until you 
 realize that *every* web app that has authentication (which one doesn't these 
 days?) shows the currently logged on user's username in an 'account details' 
 component in the top/right of each page with an option to change profile 
 settings and log out etc,. This has become much more than just a convention - 
 it's virtually a defacto standard.

 Once we add that very common account details component to the top of each 
 page the pages essentially become stateful so essentially a site with 
 predominantly stateless pages now has to be stateful.

 The main issue that I am trying to avoid by removing page versions is SEO 
 confusion whereby each time a search engine looks at a URL it sees a 
 different page version parameter in the URL. It's a similar problem to the 
 famous jsessionid parameter issue.

 Given that search engines never authenticate it prompts the question: is it 
 possible for a given page to have multiple personalities? i.e. stateless if 
 no authentication has taken place and stateful if authentication has taken 
 place.

 User's don't really care if there is an extra page version parameter in the 
 URL and this can be of great assistance in making the back button function 
 correctly - especially if their interactions have changed content on the 
 various pages (eg. showing contents of their shopping cart - hmmm, that's a 
 problem - probably always want to show the 'current' shopping cart contents 
 no matter how much they have gone 'back' otherwise things could get quite 
 confusing)

 Search engines, on the other hand, don't really want to see the extra page 
 version parameter.

 Setting up pages to have dual personalities would be a most excellent 
 solution methinks. Is this possible/easy/a good idea in Wicket?

 Is it something that is such a common requirement that it could be added to 
 the Wicket framework as a built in feature and save hours of work for both 
 experienced and newbie Wicketeers?

 If it were a switchable option built into the framework wicket would only 
 need to query the AuthenticatedWebSession.isSignedIn() to determine if each 
 page should be stateless or stateful. Or perhaps an IAuthenticator interface 
 needs to be supplied to allow it to work for developers who implement their 
 own authenticated session object.

 Just thinking aloud ... again ;)

 Regards,

 Chrisco

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: Monday, 9 January 2012 8:37 PM
To: users@wicket.apache.org
Subject: Re: stateless, not versioned pages - session problem

On Sun, Jan 8, 2012 at 4:29 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
On Sun, Jan 8, 2012 at 11:31 AM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 Not sure if I have an answer to your question but recently I asked
how
to
turn off page versioning and was told to do:

 getRequestCycleSettings().

 setRenderStrategy(IRequestCycleSettings.RenderStrategy.ONE_PASS_RENDER);

Actually this just turns off the redirecting. The pages are still
versioned.

 So would

 getPageSettings().setVersionPagesByDefault(false);

 have been a better/safer option for turning off page versioning?

Yes.

 I tried setVesionPagesByDefault(false) on its own but the version
parameters still appeared in the URL in the browser address bar. Should we
use both of the above to make page versioning disappear so as to make
Wicket 1.5 behave just like version 1.5?

Make your page stateless to not have page ids in the URL (and the page
wont be saved in the page stores too).
Otherwise you'll need special version of
org.apache.wicket.request.mapper.MountedMapper#mapHandler that doesn't
org.apache.wicket.request.mapper.AbstractComponentMapper#encodePageComponen
tInfo
for IPageRequestHandler.






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




--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com


Re: stateless, not versioned pages - session problem

2012-01-09 Thread kamiseq
any ideas about #base_domain=mydomain.com problem ;]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: stateless, not versioned pages - session problem

2012-01-09 Thread kamiseq
ok I found the reason

oAuth provider adds this #base_domain to callback url. I just dont
understand why it stayed after redirection.

the other issue (that after redirect urls looks like callback) is that
I use ReplaceHandlerException and I rewrite data from original
response to preserve cookies. so I will look at this

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: stateless, not versioned pages - session problem

2012-01-08 Thread kamiseq
ok currently im using 1.5.3 i ll check with snapshot

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: stateless, not versioned pages - session problem

2012-01-08 Thread kamiseq
ok so bind on session does the trick.
now I looked at setAttribute method and I dont understand why the flow
is altered when session is temporary.

unfortunately I still get this #base_domain=mydoamin. so 1.5-SNAPSHOT
behaves like 1.5.3
now I looked closely to url after last redirect to homepage (using
ONE_PASS_RENDER strategy) and it is exactly the same as oauth callback
plus this #base_domain=mydomain.com parameter :/
when I use default RenderStrategy.REDIRECT_TO_BUFFER then I just get
#base_domain=mydomain parameter

any ideas?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



stateless, not versioned pages - session problem

2012-01-07 Thread kamiseq
hej
I have weird problem with session that I cannot explain and that I
don't fully understand.

I started with default application settings and stateful web page. and
the flow is that I
1. request homepage
2. put data to session
3. redirect to authorize with oauth provider (facebook, gmail, etc)
which in turn redirects back to my page
4. get data saved before in session
5. redirect to homepage

then I made page stateless and it works perfectly fine until I set
getPageSettings().setVersionPagesByDefault(false); (I dont need back
button functionality)
then session was not created even though I put there something (well
it is not quite right session is created but not persisted between
requests - just after I put to session I can get the data from
session, but on next request to wicket data is gone).

can you explain why is that?

one more thing after last redirect (step 5) wicket added
?#base_domain=mydomain.com to url.
when I set 
getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.RenderStrategy.ONE_PASS_RENDER);
url is as oauth callback (from step 3) and I would expect it to be
clean homepage url (ex mydomain.com/) for both render strategies

thanks for help

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: unit testing cookies after redirect

2011-12-30 Thread kamiseq
hej,
SO it seems that errors I got was because of my bad testing.

I created simple test in new project and it now works.

 the only problem is that
1. wicket tester process request twice after startPage - the first
time the page is rendered and cookies are saved into AddCookieAction.
then request is processed second time and this time all actions are
invoked and cookie is finally added to second response. Is this
because wicket is always redirecting browser with render request??
2. after request is fully processed the original request and response
are saved as lastRequest and lastResonse (llok at
recordRequestResponse in WicketBaseTester). cookies are in
tester.getLastResponse().getCookies()
3. the thing which is not intuitive is the fact that after one request
is fully processed the new request (and response) is created but
cookies from last response are not rewritten to it. cookies will be
added when new request will be processed by tester on next startPage.

I think that's it, hope I got this right this time ;] and it may help someone

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: wicket migrating getConverter to 1.5

2011-11-28 Thread kamiseq
;] hehe yep this is a little misunderstatement ;] from that point this is ok.

well as vineet said it is small gain but it will be less confusing for
coders. (we are just discussing, right?? no hard feelings ;])

what about locator issue I pointed out??

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 28 November 2011 12:47, vineet semwal vineetsemwal1...@gmail.com wrote:

 martin,
 i actually know what you are referring to user code and library code :)
 i am not saying dont do that cast,just saying it can be hidden from a
 wicket user,
 wicket user will just override the new method which will have
 formcomponent generic type,the getconverter(*) method will call the
 new method ,do casting etc. like it was discussed in that thread..

 but yeah the gain is not worth the pain ..

 On Mon, Nov 28, 2011 at 3:50 PM, Martin Grigorov mgrigo...@apache.org wrote:
  :-)
  We have different understanding of what is user code ...
  I mean that you do that once in the component (e.g. DateTextField) and
  then you can do:
  Date asDate = dateField.getConverter(Date.class).convertToObject(..., 
  locale)
  Calendar asCalendar =
  dateField.getConverter(Calendar.class).convertToObject(..., locale)
  Integer sinceEpoch =
  dateField.getConverter(Integer.class).convertToObject(..., locale)
  ...
 
  So, you do the cast in the library code (it doesn't matter that the
  component is yours. in this case you have your own library) and from
  there on all clients of this component don't need to cast.
 
  On Mon, Nov 28, 2011 at 10:05 AM, vineet semwal
  vineetsemwal1...@gmail.com wrote:
  public final C IConverterC getConverter(ClassC clazz)
  {
    if (Date.class.isAssignableFrom(clazz))
    {
        return (IConverterC)converter;  // cast
    }
    else
    {
    return super.getConverter(clazz);
    }
  }
 
  On Mon, Nov 28, 2011 at 1:24 PM, Martin Grigorov mgrigo...@apache.org 
  wrote:
  Hi Vineet,
 
  Can you paste an example that needs casting in the users' code ?
 
  On Mon, Nov 28, 2011 at 8:20 AM, vineet semwal
  vineetsemwal1...@gmail.com wrote:
  you are right cast is only done once but it is done by *wicket users*
  when they override the method,
  it can be avoided  by introducing the new method like it is discussed
  in the that thread but the gain is
  minimal..
 
  On Sun, Nov 27, 2011 at 8:55 PM, Martin Grigorov mgrigo...@apache.org 
  wrote:
  On Sun, Nov 27, 2011 at 4:11 PM, kamiseq kami...@gmail.com wrote:
  dont get me wrong, technically it is OK, it is just the logic is
  unclear and code redundant.
 
  In my opinion frameworks are build to simplify work, that's why I said
  it should ring bells - this goes in wrong direction.
 
  I think this response
  http://apache-wicket.1842946.n4.nabble.com/Can-t-properly-override-getConverter-on-FormComponent-subclasses-tp3744435p3744867.html
  explains that the cast is done once, in the library code, and then all
  users' code gain from that. No casts in the users' code
 
 
  I perfectly understand that Component has no idea of type declared on
  descendant but for me it simply doesnt matter. Component should knew
  itself that it has converter and if there is none it should ask
  application for any. now this two step process is implemented in one
  method.
 
  Component.java has no converter. Its #getConverter() just delegates to
  the ConverterLocator
  Any component may have its own converter, but since Component class
  has no generic type and IConverter class has such we experience
  troubles when we want to mix the generic type of for example
  FormComponentT with IConverterT because FormComponent's T is
  declared at type level, and IConverter's T at method level
  (Component.getConverter()), and as a result Java says that these T's
  are not the same type.
 
 
  I just dont understand why getting converter is so strict right now, 
  thats all
 
  Try to improve it. Play with the source and if you have success come
  back with your solution.
 
 
  pozdrawiam
  Paweł Kamiński
 
  kami...@gmail.com
  pkaminski@gmail.com
  __
 
 
 
  On 27 November 2011 15:55, Martin Grigorov mgrigo...@apache.org 
  wrote:
  Hi,
 
  On Sun, Nov 27, 2011 at 3:52 PM, kamiseq kami...@gmail.com wrote:
  well yeah this is exactly the same except for locator.
 
  code like this
  public final C IConverterC getConverter(ClassC clazz)
  {
     if (Date.class.isAssignableFrom(clazz))
     {
         return (IConverterC)converter;
     }
     else
     {
     return super.getConverter(clazz);
     }
  }
  should always ring bells that something is wrong.
 
  Care to explain what exactly is wrong ?
 
 
  anyway I think that type checking should be done while registering 
  the
  converter and not while getting it.
 
  pozdrawiam
  Paweł Kamiński
 
  kami...@gmail.com
  pkaminski@gmail.com
  __
 
  -
  To unsubscribe, e-mail

Re: How to test just a panel using apache wicket?

2011-11-27 Thread kamiseq
well im talking about 1.5.3, and it is not like you startPanel and it
works, as it will try to call constructor with one parameter of the string
type. If your panel has constructor with more than only id then you cant
simply use it.

so i guess this was a case where ITesterPanelSource was useful but now it
is deprecated. And the javadoc says that startComponent should be used
instead but this is not the same functionality and it is quite confusing to
me.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: How to test just a panel using apache wicket?

2011-11-27 Thread kamiseq
ok I think I was blind yesterday ;] and I need to admit that javadoc is
correct and says exactly the same thing (to use startComponentInPage(C
component)

thanks ;]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


wicket migrating getConverter to 1.5

2011-11-27 Thread kamiseq
hi all,
In 1.5 getConverter has new signature using generics : public C
IConverterC getConverter(ClassC type)

and this is nice when you have global converter registered in
application but in 1.4 it was handy to return different converter in
specific component by overriding its getConverter(type).

now it is also possible but it requires casting from C type to target
type of the component and then back to C. for me this is a bit
inconsistent as component always knows which type it using.
maybe there should be additional method that can be overridden and it
will return converter of type declared on component, what do you
think??

public abstract class LinkL
{
public Link(String id, IModelL model)
{
super(id, model);
}

@Override
public IConverterL getConverter()
{
return new MyCustomConverterThatIsUsingTypeL;
}
}

and another things is how ConverterLocator sets converters.
it is possible to register converter that doesnt match key type

ConverterLocator locator = (ConverterLocator) super.newConverterLocator();
locator.set(MyType.class, new IConverterString()
{
@Override
public String convertToObject(String value, Locale locale)
{
return null;
}

@Override
public String convertToString(String value, Locale locale)
{
return null;
}
});

where set should be declared as public final C IConverterC
set(final ClassC c, final IConverterC converter).

how you deal with this things? maybe there is a better way
thanks

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: wicket migrating getConverter to 1.5

2011-11-27 Thread kamiseq
something like that, my google didnt show any result for getConverter 1.5 ;]

I will read that, thanks

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: wicket migrating getConverter to 1.5

2011-11-27 Thread kamiseq
well yeah this is exactly the same except for locator.

code like this
public final C IConverterC getConverter(ClassC clazz)
{
if (Date.class.isAssignableFrom(clazz))
{
return (IConverterC)converter;
}
else
{
return super.getConverter(clazz);
}
}
should always ring bells that something is wrong.

anyway I think that type checking should be done while registering the
converter and not while getting it.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: wicket migrating getConverter to 1.5

2011-11-27 Thread kamiseq
dont get me wrong, technically it is OK, it is just the logic is
unclear and code redundant.

In my opinion frameworks are build to simplify work, that's why I said
it should ring bells - this goes in wrong direction.

I perfectly understand that Component has no idea of type declared on
descendant but for me it simply doesnt matter. Component should knew
itself that it has converter and if there is none it should ask
application for any. now this two step process is implemented in one
method.

I just dont understand why getting converter is so strict right now, thats all

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__



On 27 November 2011 15:55, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 On Sun, Nov 27, 2011 at 3:52 PM, kamiseq kami...@gmail.com wrote:
 well yeah this is exactly the same except for locator.

 code like this
 public final C IConverterC getConverter(ClassC clazz)
 {
    if (Date.class.isAssignableFrom(clazz))
    {
        return (IConverterC)converter;
    }
    else
    {
    return super.getConverter(clazz);
    }
 }
 should always ring bells that something is wrong.

 Care to explain what exactly is wrong ?


 anyway I think that type checking should be done while registering the
 converter and not while getting it.

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

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





 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

 -
 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



Re: wicket migrating getConverter to 1.5

2011-11-27 Thread kamiseq
fair enough ;]


pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: How to test just a panel using apache wicket?

2011-11-26 Thread kamiseq
for me this does not works either in 1.5.3 as inner test page has no markup

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__





Re: How to test just a panel using apache wicket?

2011-11-26 Thread kamiseq
the javadoc of ITesterPanelSource says Depreced since no longer needed in
1.5.3

can you give examples?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: RestartResponseAtInterceptPageException from onClick

2011-11-21 Thread kamiseq
ok thanks for quick replay,

I think there should be more info in javadoc about the intension fo the
exception and continueToOriginalDestination method

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 21 November 2011 03:40, Bertrand Guay-Paquet ber...@step.polymtl.cawrote:

 Hi,

 If you need a reference to the referrer, you could simply store the
 current page's PageReference which is available with
 getPage().getPageReference(). Then use setResponsePage(SignInPage.**class)
 to go to the login page. PageReference is a serializable id that can later
 be used in your login form submit method with setResponsePage(pageRef.**
 getPage());

 There is no need for using the exception mechanism for this. Storing in
 the session means that multiple tabs won't work. You might want to send the
 pageRef directly as a parameter to the SignInPage constructor instead, but
 it will make your page stateful.

 Bertrand


 On 20/11/2011 5:59 PM, kamiseq wrote:

 hej,
 I'm just looking form clarification on
 RestartResponseAtInterceptPage**Exception and
 continueToOriginalDestination(**).

 On every page I have a log-in link, and after log in I should be
 redirected
 back to the original destination. I use oauth api that requires that I
 redirect user to external url and then user will be redirected back to my
 service.
 In handler for onClick i have

 new RestartResponseAtInterceptPage**Exception(MainPage.class);
 throw new RedirectToUrlException(url);

 intercept page does not matter as I do not throw the exception I just save
 InterceptData in session so next time I call
 continueToOriginalDestination(**) this data will be used.

 the only problem is that while saving (from
 RestartResponseAtInterceptPage**Exception.InterceptData)

 Request request = RequestCycle.get().getRequest(**);
 data.originalUrl = request.getOriginalUrl();

 originalUrl point to onClick callback and then app loops.

 I could of course save page instance and then redirect to it, but this is
 reinventing the mechanism that wicket already provides, isn't it?
 I know that RestartResponseAtInterceptPage**Exception is used with
 accessing
 protected resources with IUnauthorizedComponentInstanti**ationListener
 and
 then url always points to page and not to handler.

 thanks for any comment on that

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __


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




Re: unit testing cookies after redirect

2011-11-21 Thread kamiseq
ok I ll do it this week

thanks

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 21 November 2011 09:52, Martin Grigorov mgrigo...@apache.org wrote:

 Hi,

 I have also noticed that once but didn't have time to investigate it
 further and later I forgot about it ...
 Can you create a simple quickstart and attach it to Jira.

 On Sun, Nov 20, 2011 at 10:41 PM, kamiseq kami...@gmail.com wrote:
  hej,
  well I tried to follow the cookies in wicket tester.
 
  starting from the beginning I have page A that while constructing adds
 new
  cookie to response and throws (as Martin advised) ReplaceHandlerException
  pointing to page B.
  everything goes well and cookies are carried inside original response
 until
  BaseWicketTester.processRequest(forcedRequest, forcedRequestHandler,
  redirect) - setupNextRequestCycle()
 
  were new request and new response is created and my cookies info is gone
 :/
  I guess that cookies from last response should be rewritten to new
 request,
  right??
 
  I a bit confused how this works here, I have problems with cooking when
 Im
  testing it inside jetty so maybe this is something on my side only :/
 
  any ideas?
 
  pozdrawiam
  Paweł Kamiński
 
  kami...@gmail.com
  pkaminski@gmail.com
  __
 
 
  On 9 November 2011 15:01, kamiseq kami...@gmail.com wrote:
 
  so if this is the last line in my code those two approaches are pretty
 the
  same
 
  pozdrawiam
  Paweł Kamiński
 
  kami...@gmail.com
  pkaminski@gmail.com
  __
 
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




Re: unit testing continueToOriginalDestination

2011-11-21 Thread kamiseq
it sounds like a plan ;]

I thought it will be something in wicket tester, thanks for a hint anyway ;]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: unit testing continueToOriginalDestination

2011-11-21 Thread kamiseq
again sounds like a plan ;]

ok, I will try to do that at the end of the week

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


2011/11/21 Igor Vaynberg igor.vaynb...@gmail.com

 We can build it in...open a jira and attach a patch :)

 -igor
 On Nov 21, 2011 10:51 AM, kamiseq kami...@gmail.com wrote:

  it sounds like a plan ;]
 
  I thought it will be something in wicket tester, thanks for a hint anyway
  ;]
 
  pozdrawiam
  Paweł Kamiński
 
  kami...@gmail.com
  pkaminski@gmail.com
  __
 



unit testing continueToOriginalDestination

2011-11-20 Thread kamiseq
hej,
Im a bit stuck, I tried to search something but all resources points to
older version and it seems that in 1.5 a lot ve changed.

I have a page that does its work and then continueToOriginalDestination or
it this returns false do some more stuff.
unit testing the case when it returns false was easy ;] but now I try to
figure out how to test that my code calls continueToOriginalDestination and
tries to redirect.

I tried this
http://www.mail-archive.com/users@wicket.apache.org/msg09904.html

but this was for wicket 1.3

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: unit testing cookies after redirect

2011-11-20 Thread kamiseq
hej,
well I tried to follow the cookies in wicket tester.

starting from the beginning I have page A that while constructing adds new
cookie to response and throws (as Martin advised) ReplaceHandlerException
pointing to page B.
everything goes well and cookies are carried inside original response until
BaseWicketTester.processRequest(forcedRequest, forcedRequestHandler,
redirect) - setupNextRequestCycle()

were new request and new response is created and my cookies info is gone :/
I guess that cookies from last response should be rewritten to new request,
right??

I a bit confused how this works here, I have problems with cooking when Im
testing it inside jetty so maybe this is something on my side only :/

any ideas?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


On 9 November 2011 15:01, kamiseq kami...@gmail.com wrote:

 so if this is the last line in my code those two approaches are pretty the
 same

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __



RestartResponseAtInterceptPageException from onClick

2011-11-20 Thread kamiseq
hej,
I'm just looking form clarification on
RestartResponseAtInterceptPageException and continueToOriginalDestination().

On every page I have a log-in link, and after log in I should be redirected
back to the original destination. I use oauth api that requires that I
redirect user to external url and then user will be redirected back to my
service.
In handler for onClick i have

new RestartResponseAtInterceptPageException(MainPage.class);
throw new RedirectToUrlException(url);

intercept page does not matter as I do not throw the exception I just save
InterceptData in session so next time I call
continueToOriginalDestination() this data will be used.

the only problem is that while saving (from
RestartResponseAtInterceptPageException.InterceptData)

Request request = RequestCycle.get().getRequest();
data.originalUrl = request.getOriginalUrl();

originalUrl point to onClick callback and then app loops.

I could of course save page instance and then redirect to it, but this is
reinventing the mechanism that wicket already provides, isn't it?
I know that RestartResponseAtInterceptPageException is used with accessing
protected resources with IUnauthorizedComponentInstantiationListener and
then url always points to page and not to handler.

thanks for any comment on that

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: wicket 1.5.3 problems with cookies

2011-11-19 Thread kamiseq
hej,
so I tired CookieUtils and still cookies are not persisted.

I ve checked it both on GAE and jetty

I can try setup fresh wicket and check it there but it just strange

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: Apache Wicket is a Flawed Framework

2011-11-18 Thread kamiseq
well, I have nothing against writing my own SQL with spring;]

but it is true that before I read wicket in action I was like a child in fog :/

after JSP I started palying with tapestry and tapestry has a bit
better introduction pages. it is not that there is not enough
information around but wicket lacks free introduction that shows the
wicket way (but maybe I could not find it). looking at wicket stuff is
hard at the beginning.

I tried vaadin and tapestry and I still find wicket as very nice
framework anyway I would never ever go back to JSP ;]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__



On 18 November 2011 10:35, Chris Colman chr...@stepaheadsoftware.com wrote:
Breaks POJOS:  A real POJO does not need to implement an interface or
extend a class.

 A object oriented framework is a foundation on which you extend your
 application. Back in the C++ world there was MFC, OWL, .Net, etc., In
 the Java world there was AWT and then Swing etc.,. All event driven,
 object oriented component based frameworks. All were pretty easy to
 build desktop applications in.

 Most of an application's UI elements extended from core classes in the
 framework. That's just how you use OO frameworks. If you want to write
 UI elements that do not extend or implement classes of interfaces of a
 'framework' then you're not really using any framework and reinventing
 the wheel.

Bad Defaults:  Most pages are stateless.

 Every page in our app is stateful. We show the username of the current
 user at the top of the page after logging on and we also have a panel on
 the right that shows alerts specific to the current user. Sure the main
 content of each page is not delivered differently per user but many of
 the auxiliary components are.

Causes a redeploy whenever you add anything:  Maybe Java developers are
used to this, but in any other web development environment I do not
 need to
redeploy after adding a text box to the page.

 We use a component resolver. That can make it possible for the HTML
 markup to drive the component hierarchy without explicitly adding
 components in Java code each time you want to add a new component.

Stateful Component based framework are a terrible idea:  Even at the
theoretical level this is a bad idea. It is a leaky abstraction over a
simple request/response cycle.

 My examples of desktop app frameworks above were all event driven,
 object oriented, component based frameworks. This model evolved to be
 *universal* in the desktop world for a good reason - it's a damn fine
 architecture IMHO and obviously in the opinion of the rest of the world
 of desktop application developers.

 Einstein said, Make something as simple as possible but not too
 simple. Request/response is just too simple to be useful for anyone who
 has come through from the desktop application world and 'gets' event
 driven, object oriented component based architectures.

 When I moved from desktop to web development I went CGI, servlets, JSPs,
 Struts, Echo and now Wicket. Until I started using Echo  Wicket my web
 app days were never as fun or 'clean' as ye olde desktop app days. For
 me Wicket is the ONLY web UI framework that gives me the same kind of
 development productivity and clean, reusable application source code
 that I enjoyed in the desktop app development world.


It made something simple and made it overly complicated.  This remind
 me of Hibernate and ORMS.

 Yeah, ok, if you're not using an ORM in your apps by now and still
 spending your days writing SQL glue code then we need to have a talk ;)

 Chris

 -
 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



Re: wicket 1.5.3 problems with cookies

2011-11-17 Thread kamiseq
hi martin,
so yes previously I had a problem with unit tests when I was setting
cookie and redirecting with throw new RestartResponseException(new
MyOtherPage());
then you advised to used NonResettingRestartException but this for
some reason (I had no time yet to investigate) is breaking unittest so
now I am using setResponsePage(pageClass);

now I try to test it live with jetty and gae and for both servers it
is failing. (to redirect I use setResponsePage)

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



wicket 1.5.3 problems with cookies

2011-11-16 Thread kamiseq
hej,
it seems that wicket is not storing cookies :/.

im adding TEST cookie with

final Cookie cookie = new Cookie(name, value);
cookie.setMaxAge(Integer.MAX_VALUE);
((WebResponse)getResponse()).addCookie(cookie);

and reading it on different page

final ListCookie cookies = ((WebRequest) getRequest()).getCookies();
Cookie result = null;
for (Cookie cookie : cookies)
{
final String name = cookie.getName();
log.fine(checking cookie name=+ name);
if (name.equals(cookieName))
result = cookie;
}
return result;

but only
checking cookie name=JSESSIONID is logged

this is very odd :/ any ideas?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: unit testing cookies after redirect

2011-11-09 Thread kamiseq
so if this is the last line in my code those two approaches are pretty the same

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: unit testing cookies after redirect

2011-11-08 Thread kamiseq
ok, thanks for that.

I have one small question that is bugging me for a while.

What would be the difference between throwing exception or
setResponsePage(pageClass);??
I ve found somewhere that I should always throw RestartException, but
I see setResponsePage so many times that Im confused.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



unit testing cookies after redirect

2011-11-06 Thread kamiseq
hej,

I ve found this
http://apache-wicket.1842946.n4.nabble.com/Wickettester-cookies-and-redirects-in-Wicket-1-4-15-td3250792.html

but im developing on 1.5.2 and ticket is closed. I believe it is the same case.

this is description:
I have a page ValidationPage that accepts request, checks parameters
and sets cookie on response object

((WebResponse)getRequestCycle().getResponse()).addCookie(new
Cookie(mycookie, VAL));

then on certain condition I want to redirect to original destination
or to some set page

if (!continueToOriginalDestination())
{
    log.warning(redirect failed redirecting to original destination);
    throw new RestartResponseException(new MyOtherPage());
}

so in test

tester.startPage(ValidationPage.class, pageParameters);
tester.assertRenderedPage(MyOtherPage.class);
final Cookie[] cookies = tester.getRequest().getCookies();
assertNotNull(cookies); -  fail

and I get null, I tried Reponse object but no luck. I thought cookies
should be resend in next request back to server right?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: request parameters

2011-11-01 Thread kamiseq
I understand you mean something like this

final StringValue val1 = parameters.get(val1);
final Service service = ServiceFactory.getClient(val1);

final IRequestParameters requestParameters =
getRequest().getQueryParameters();
final SetString parameterNames = requestParameters.getParameterNames();
MapString, String params = new HashMapString,
String(parameterNames.size());
for (String name : parameterNames)
{
final StringValue val = requestParameters.getParameterValue(name);
params.put(name, val.toString());
}
service.handle(params);

giving it a second thought I could use

final ListPageParameters.NamedPair named = parameters.getAllNamed();

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


request parameters

2011-10-31 Thread kamiseq
hej,
I need to obtain request parameters as Map like I would if I had
access to HttpServletRequest but with PageParameters I can't find a
way to do it

I have mounted page with pattern : /mypage/${param1}/${param2}

so every time I get request to myapp.com/mypage/val1/val2?key=val I
would like to get map of these parameters and pass it to service that
do not know anything about Page or PageParameters, on the other hand
page don know which parameter service is interested in.
how I can solve this problem?

thanks

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: request parameters

2011-10-31 Thread kamiseq
well this is not fixed.
the url will alwyas begin with
*
myapp.com/mypage/val1/val2*

but it may also contain additional keys like

*myapp.com/mypage/val1/val2?key=val* or
*myapp.com/mypage/val1/val2?otherkey=valkeykey=val* etc

inside my page im only interested in val1, val2 and depend on those values
I will choose service impl where I want pass all key-val pairs from request.
val1/val2 parameters are not a problem I can easily get them from
PageParameters using get(String) the trouble I have is that PageParameter
object is not built under original request's Map.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__



On 31 October 2011 23:54, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 under what key should ${param1}/${param2} be stored?

 -igor

 On Mon, Oct 31, 2011 at 3:30 PM, kamiseq kami...@gmail.com wrote:
 hej,
 I need to obtain request parameters as Map like I would if I had
 access to HttpServletRequest but with PageParameters I can't find a
 way to do it

 I have mounted page with pattern : /mypage/${param1}/${param2}

 so every time I get request to myapp.com/mypage/val1/val2?key=val I
 would like to get map of these parameters and pass it to service that
 do not know anything about Page or PageParameters, on the other hand
 page don know which parameter service is interested in.
 how I can solve this problem?

 thanks

 pozdrawiam
 Paweł Kamiński

 kami...@gmail.com
 pkaminski@gmail.com
 __

 -
 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




oauth client with wicket

2011-10-30 Thread kamiseq
hej,
Im trying to add simple user authorisation to my app with oauth.

in order to authenticate and authorize a user I need to redirect that
user to oauth service, the redirect url contains parameter with
callback url to my app (oauth controller will send response via HTTP
302 - I am not sure if this has any impact, probably I need to read
more about it).
form callback url I can obtain user specific code and then send
another request to receive access_token to authorize all my operation.

(I havent tested it yet so this all theory)
I ve already created a filter to handle callback and do all I need,
then I am sending redirect to wicket app once Im done.

but I think I could create a Page and use it's getPageRelativePath()
as a callback url (something like
http://url_to_wicket_app/callbackHandlerPage) and handle response
there. What do you think?
I ll be inside wicket so any exception will be handled by wicket and
proper error page will be displayed.

another problem is that I need to support more then one aouth service
(like facebook, twitter, etc) so I thought I could add a token value
to callback url (something like
http://url_to_wicket_app/callbackHandlerPage/twitter) and then strip
this token and put it to parameter map.
Is there a way to filter a request before it hits target page using
wicket configuration or should I use custom filter defined in web.xml?


pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: form component that is rendered as select or read-only input

2011-07-03 Thread kamiseq
why not call this code in onBeforeRender?? as I read Component code
onConfigure is called once per request and so is onBeforeRender and javadoc
states that

NOTE: Component hierarchy should not be modified inside this method
(onConfigure), instead it should be done in {@link #onBeforeRender()}

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


form component that is rendered as select or read-only input

2011-07-02 Thread kamiseq
hej,
Im creating a component that is a panel - part of a form. I pass a
LoadableDetachableModel to it with a list of items.
when list size is greater then 1 I display a select html component to render
all choices. but when list contains only one item I would like to show read
only input because at this time user will not be able to choose another item
anyway.

but when I close a page with form and update list (ie item was added so
there is more than one or items was removed so there is only one item) and
reopen the page with the form again I will see form with wrong component
(right?) as whole page was saved and panel with form components will not be
created again (right?).

how can I design this panel so it is more dynamic? should I use repeaters?
or something like that?
thanks for any help

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: form component that is rendered as select or read-only input

2011-07-02 Thread kamiseq
hym ;]

thanks;]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


how to setup guice in unit test

2011-06-22 Thread kamiseq
hej,
I ve found something something like this
http://blog.yanivkessler.com/2010/06/writing-unit-tests-for-guicey-wicket.htmlbut
I think there should be some easier way to setup guice DI. I tried to
use AtUnit but it doesnt work with webpages( I get
*org.apache.wicket.WicketRuntimeException:
There is no application attached to current thread main *or object are not
simply injected)

can you explain how to configure it?*
*
pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: how to setup guice in unit test

2011-06-22 Thread kamiseq
ok, then I think I just took the wrong turn ;] I dont know why they bother
themselves with custom testRunner

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


widgets support

2011-06-18 Thread kamiseq
hi,
I need to create simple service that returns html content and then talks to
my client with json. I would like to integrate this with other
services/daos/etc I have injected to my pages.

this 'widget' will not be a part of a page from the beginning but should be
a part of application. some script on the page will call the service and it
should respond with json so client could render itself or with html to speed
up that initialization.

what do you think, where should I start looking.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: Basic TextField question

2011-06-07 Thread kamiseq
why cannot you change value in model and detach it?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: guice injection on WebApplication init

2011-06-05 Thread kamiseq
hi,
I have one small question : how to write tests if I configured Application
with GuiceWebApplicationFactory?

I ve found AtUnit project but this depends on basic configuration inside
application class.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: guice injection on WebApplication init

2011-05-31 Thread kamiseq
ok GuiceWebApplicationFactory works like a charm. but now I consider moving
this init db code to custom guice module so I can easily swap configuration
and have WebApplication class clean;]
again thanks for replay

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: guice injection on WebApplication init

2011-05-31 Thread kamiseq
heh ok I tired to be too smart ;] anyway thanks

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


guice injection on WebApplication init

2011-05-30 Thread kamiseq
hi,
my wicket application uses guice to inject services and dao-s. it works fine
but recently I started to use in-memory db.
so I need somehow initialize(create tables, insert some sample data) my db
after getComponentInjector() and before getHomePage().

of course I could (out of guice configuration) create new DataSource and run
code in WebApplication.init() method but this seems to me as big hack.

can somebody help me with that.

thanks

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: guice injection on WebApplication init

2011-05-30 Thread kamiseq
thanks for a quick replay Ill try this tomorrow :]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: FormComponent convertInput for children FormComponets

2011-05-18 Thread kamiseq
maybe you need to set type for each control, I had similar issue. look at
the wicket code where the value is set.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


wicket tags

2011-04-28 Thread kamiseq
hi,
this is more about how you guys working with wicket rather then a bug or
something. and as Im relativelly new to wicket maybe you can help me out.

I created panels that can be extended ie.

wicket:panel
   headermy header/header
   form
  wicket:child/wicket:child
  input type=text /
   /form
/wicket:panel

usually I style the component in offline mode (without running the server)
so I need to add some additional markup to mock it, plus I set wicket to
strip wicket tags and override onComponentTag to set name of the tag (let
say section) so it look like.

section class=custom-component-class
wicket:panel!-- this will go away --
   headermy header/header
   form
  wicket:child/wicket:child
  input type=text /
   /form
/wicket:panel
/section

so now the problem is that

   1. I cannot use css selector like section.custom-component-class  header
   or I need to comment the wicket:panel tag on time I style component
   2. wicket:child is not recognized as valid html tag so I cannot add style
   to it ie. display:none
   3. surrounding wicket:child element with some html tag makes no sens

why wicket tags couldnt be attributes so any valid html could have attribute
like wicket:behavior=panel or type=child or something like that

I know that this is not a big issue. probably designer should create html +
css styles first and then developer turn it into the working code but with
time things like that are annoying,

so how do you work with such problems?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: wicket tags

2011-04-28 Thread kamiseq
I know I can work around this, it is just I see it as a place to improve
framework.

I want to use immediate-child selectors because I see benefits from this
whatever that is
I know that in runtime those tags goes away but while working with raw html
files (let say graphic designer takes them and fixes some bugs with
styling/rendering) he needs to think about wicket as well.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: formComponentPanel with content generated by RepeatingView

2011-04-24 Thread kamiseq
yep I did it like that and it works

public class Editor extends FormComponentPanelListString {
private ListViewString item;

/**
 * If you dont have ArrayList you can always copy your collection to new
ArrayList.
 *
 * @param id of the control
 * @param accounts a list of all accounts assigned to the peron.
 */
public Editor(String id, IModel items) {
super(id, items);
buildComponents();
}

private void buildComponents()
{
setOutputMarkupPlaceholderTag(false);
add(new SimpleAttributeModifier(class, editor-panel));

final ListString items = getModelObject();
item = new ListViewString(item, items){

@Override
protected void populateItem(ListItemString listItem)
{
String number = listItem.getModelObject();
listItem.add(new NumberInput(number, number));
listItem.add(new RemoveButton(remove, number, items));
}
};
item.setReuseItems(true);
Link addButton = new Link(add){

@Override
public void onClick() {
items.add();
item.detach();
}
};
add(addButton);
add(item);
}

@Override
protected void onComponentTag(ComponentTag tag) {
tag.setName(section);
super.onComponentTag(tag);
}

@Override
protected void convertInput()
{
setConvertedInput(saveConvertedData());
}

private ListString saveConvertedData()
{
final ListString items = new ArrayListString();
item.visitChildren(NumberInput.class, new
Component.IVisitorNumberInput(){
@Override
public Object component(NumberInput component) {
String number = component.getConvertedInput();
items.add(number);

return Component.IVisitor.CONTINUE_TRAVERSAL;
}
});
return items;
}
}

thanks for help

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: formComponentPanel with content generated by RepeatingView

2011-04-23 Thread kamiseq
heh i thought I was smart :] as each component in FormComponentPanel is
converted and validated so it would be easy to intercept value set on
components model and add it to List (which is model of whole FCPanel)
because Im not really converting components value to something bigger.

the only problem is getting value for each component as interface is only
getObject and setObject so there is no information model could decide which
value goes to which component

;]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: formComponentPanel with content generated by RepeatingView

2011-04-22 Thread kamiseq
hej,
on the second thought I can implement (in this simple case) a model backuped
by List or Set and then let Form (or FormComponentPanel) to process all
fields.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


formComponentPanel with content generated by RepeatingView

2011-04-21 Thread kamiseq
hi,
Im trying to implement a simple form component that accepts List of Strings

*public class AccountsPanel extends FormComponentPanelListString
{
****public AccountsPanel(String id, ArrayListString accounts) {
******super(id, new Model(accounts));
buildComponents();
}
}

*and I am using RepeatingView to create as many TextField as many Strings
are in the List, and this is fine but how then convert each edited value of
the TextField back to List of Strings???

using convertInput would be a good choice I guess but I have no idea how to
iterate over panel's components and read value
*
@Override
protected void convertInput()
{
ListString accounts = getModelObject();*

*setConvertedInput(accounts);
}*

or maybe this is happening automagically :D 

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: dynamic child in container

2011-04-06 Thread kamiseq
hi again,
so I really dont understand how to set hings up but I tried this yesterday
around midnight :] so please forgive me ...

let me explain again

I have simple webpage *DashboardPage* (1)

body
  a wicket:id=editwicket:message key=/w:m/a
/body

then I created a panel with a form *UserFormPanel*(2)

body
  wicket:panel
div class=popup
  form wicket:id=userData
input .. /
input type=submit /
  /form
  a wicket:id=cancelgo back/a
/div
  /wicket:panel
/body

in *DashboardPage* I created AjaxLink for *edit* and tried to add *
UserFormPanel* to requestTarget when link is clicked, but in turn wicket
refused that saying the component has no outputMarkupID set to true (but it
doesnt tell on which component I should set that property).
the other thing is that I need to assign some wicket:id to
*UserFormPanel*created in link callback. but this id does not
correspond to any id in
markup so I get (think I get:) an exception.

how to set components right?
I really cannot find anything on the web about this! is this so rare
situation in wicket world???

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


dynamic child in container

2011-03-29 Thread kamiseq
hi, I ve googled a bit but all I ve found are links about panels.

my problem is that I would like to create components (with corresponding
html markup) and then add those components dynamically on request to target
container, where child component could be other container that might be
dynamically modified.
what I read about panels is that you need always mark a placeholder for a
child component so there is no way to add more or less child when my logic
decides to do so.

is this possible in wicket? could someone point me to some materials about
it?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: dynamic child in container

2011-03-29 Thread kamiseq
thanks,
so I understand that it is only possible with AJAX calls. could I make a
link callback that will add random number of components on each request?
there will be no wicket:id for dynamic child and I could generate as many
components as I want, right?

I will try this anyway;]

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: wicket via websocket

2010-11-22 Thread kamiseq
thanks, I run into the first page but I was curious if I can do this
depending only on wicket. but I will give it a try again

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__