Re: Using tomcat server in wicket application

2013-02-18 Thread Martin Grigorov
On Sun, Feb 17, 2013 at 10:16 PM, kshitiz k.agarw...@gmail.com wrote:

 I found the reason of my cause which is perhaps a very stupid one. Posting
 the answer in case any one find himself in the same trouble. There was no
 web.xml file in web-inf folder of webContent. Tomcat was not able to find
 the file and so was throwing error. Quickstart does not place web.xml in
 that folder as it structures the project as per jetty server.


It is not per Jetty server.
src/main/webapp is the standard folder where WEB-INF/ is in Maven-like
projects (Gradle, SBT, Buildr also use this as default).
'webContent' is what your IDE uses as a folder for all web resources. This
differs for every IDE.

In the end all that matters is the built .war file. I recommend you to get
familiar with its structure.





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Using-tomcat-server-in-wicket-application-tp4656251p4656450.html
 Sent from the Users forum mailing list archive at Nabble.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 http://jweekend.com/


Re: Forward request to an external filter

2013-02-18 Thread Martin Grigorov
Hi,

Wicket doesn't provide an API for internal forwards. Use the Servlet API
for this.

Also check https://github.com/fernandezpablo85/scribe-java for OAuth. It is
very simple to use it.


On Thu, Feb 14, 2013 at 4:34 PM, Leonid Bogdanov leonid_bogda...@mail.ruwrote:


 Hello!

   I'm trying to add OAuth authentication to a Wicket webapp and as a part
 of this I need to be able to do server-side forward of a request from
 Wicket to an external filter.
   So what is the best way to do this in Wicket? Do I need to throw some
 special exception with an URL to forward to or should do this more
 traditionally with RequestDispatcher.forward()?

 Thank you.




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


Re: Submit form before handle onclick

2013-02-18 Thread Martin Grigorov
Hi,

Use org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onAfterSubmit if you
want to execute something *after* Form#onSubmit()


On Sun, Feb 17, 2013 at 8:15 PM, Gonzalo Aguilar Delgado 
gagui...@aguilardelgado.com wrote:

 Hello Sven,

 Yes. I added this to the form, and a eventhandler to the button, but the
 event handler of the button is always called before the submit.

 The problem is that I cannot process the onclick handler of the button
 without the information of the form.

 So I think I need to submit it on the onclick handler, but how?

 Thank you in advance.


 El vie, 15-02-2013 a las 11:07 +0100, Sven Meier escribió:S
 venO
 n 02/15/2013 11:01 AM, Gonzalo Aguilar Delgado wrote:

   Hello,
  
   We have just a situation were the information of the form needs to be
   updated before handling an ajax click event.
  
   The page has a form, with a bean and some TextFields that update the
   properties in the bean.
   It has also an ajax component that also updates the bean.
  
   The problem is that we can fill in the form but if we do an event on
 the
   ajax component every field filled in first step is lost because is not
   submitted (and the bean updated) before handling the ajax click event.
  
  
   So the question is:
  
   How can we submit the form before handling the click event?
  
   Any suggestion?
  
   Thank you in advance.
  
 
 
  -
  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 http://jweekend.com/


Re: Handle the modal window size?

2013-02-18 Thread Martin Grigorov
Hi,

ModalWindow has #setInitialWidth() and #setMinWidth(). Same for height.


On Sat, Feb 16, 2013 at 1:16 PM, chrome1235 kemal.m...@gmail.com wrote:

 Hi,

 Is there any method to handle the modal window size (width and height) when
 user change it manually?

 Thanks.

 Kemal



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Handle-the-modal-window-size-tp4656427.html
 Sent from the Users forum mailing list archive at Nabble.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 http://jweekend.com/


Re: how to modify internal JavascriptResourceReference packaged with component

2013-02-18 Thread Martin Grigorov
Hi,

This is improved in Wicket 6.
You can use
org.apache.wicket.protocol.http.WebApplication#addResourceReplacement for
exactly this use case.
See http://wicketinaction.com/2012/07/wicket-6-resource-management/
You are recommended to upgrade your application.


On Thu, Feb 14, 2013 at 1:39 AM, Evan Sable e...@novelution.com wrote:

 Hi,

 I'm working on a project that's on wicket 1.4.  It's using
 the MultiFileUploadField class.  I see in the code for that class that in
 renderHead, it calls:
 response.renderJavascriptReference(JS);
 and earlier it defines:
 private static final ResourceReference JS = new
 JavascriptResourceReference(
 MultiFileUploadField.class, MultiFileUploadField.js);

 But, I'd like to make a minor modification to the actual javascript in
 MultiFileUploadField.js.  Specifically, I want to modify that code to
 remove the c:/fakepath prefix that appears in the box with the list of
 selected files below the field (in chrome and safari - not a problem in
 firefox and ie).  If I could just over-ride the javascript contents of that
 file, it would be an easy fix.  But, more generally, I'd like to know not
 just for this specific issue, is there a wicket way to override the
 packaged javascript resource that comes with a component?  Perhaps is there
 a simple way to extend the MultiFileUploadField class with my own class,
 and somehow keep the rest of the code as is, but specify an alternate
 resource?  It's private in that class, so I don't see how I'd do this, but
 maybe I'm missing something obvious.  Or maybe is there some way to keep
 using the same class but to tell the application that I want to replace the
 corresponding javascript file with my own?  Or is there some other approach
 I should be taking when this type of issue comes up?

 Thanks very much for any advice,
 -Evan




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


Re[2]: Forward request to an external filter

2013-02-18 Thread Leonid Bogdanov

Hello, Martin!

    Thank you for your response! Actually I already use Scribe lib, but 
indirectly - through Shiro OAuth plugin.

Thank you.


Monday, 18 Feb 2013, 10:06 +02:00 from Martin Grigorov mgrigo...@apache.org:
Hi,

Wicket doesn't provide an API for internal forwards. Use the Servlet API
for this.

Also check  https://github.com/fernandezpablo85/scribe-java for OAuth. It is
very simple to use it.


On Thu, Feb 14, 2013 at 4:34 PM, Leonid Bogdanov  leonid_bogda...@mail.ru 
wrote:


 Hello!

   I'm trying to add OAuth authentication to a Wicket webapp and as a part
 of this I need to be able to do server-side forward of a request from
 Wicket to an external filter.
   So what is the best way to do this in Wicket? Do I need to throw some
 special exception with an URL to forward to or should do this more
 traditionally with RequestDispatcher.forward()?

 Thank you.




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




Re: Multipart ajax form submit channel

2013-02-18 Thread Martin Grigorov
Hi,

This is improved in Wicket 6.
Please upgrade your application.


On Wed, Feb 13, 2013 at 11:28 PM, Ashley Reed ajree...@gmail.com wrote:

 I just wanted to ask this question before figuring out how to file a bug.
 I'm using Wicket 1.5.6, and it seems like multipart ajax form submits don't
 block the ajax channel. I'm doing an ajax submit that causes the form to go
 away, and other ajax links on the form don't wait until the form submission
 is complete. The result is that other ajax links cause an exception if
 they're clicked before the form submission is complete because the objects
 no longer exist in the page. I would think the precondition on the links
 shouldn't be tested until the channel is available. Is this a bug?

 Thanks,
 Ashley

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




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


Re: Re[2]: Forward request to an external filter

2013-02-18 Thread Martin Grigorov
Hi Leonid,

I have no experience with Apache Shiro.
I can blog about how to use Scribe directly in Wicket if this will help you.


On Mon, Feb 18, 2013 at 10:18 AM, Leonid Bogdanov
leonid_bogda...@mail.ruwrote:


 Hello, Martin!

 Thank you for your response! Actually I already use Scribe lib, but
 indirectly - through Shiro OAuth plugin.

 Thank you.


 Monday, 18 Feb 2013, 10:06 +02:00 from Martin Grigorov 
 mgrigo...@apache.org:
 Hi,
 
 Wicket doesn't provide an API for internal forwards. Use the Servlet API
 for this.
 
 Also check  https://github.com/fernandezpablo85/scribe-java for OAuth.
 It is
 very simple to use it.
 
 
 On Thu, Feb 14, 2013 at 4:34 PM, Leonid Bogdanov 
 leonid_bogda...@mail.ru wrote:
 
 
  Hello!
 
I'm trying to add OAuth authentication to a Wicket webapp and as a
 part
  of this I need to be able to do server-side forward of a request from
  Wicket to an external filter.
So what is the best way to do this in Wicket? Do I need to throw some
  special exception with an URL to forward to or should do this more
  traditionally with RequestDispatcher.forward()?
 
  Thank you.
 
 
 
 
 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com  http://jweekend.com/ 
 




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


Re: Handle the modal window size?

2013-02-18 Thread chrome1235
Martin, thanks for your reply.But I need that when the user *resize* the
modal window *by mouse*. Can I get the new dimensions(changed by mouse). If
I can get, then i will save it to session. So, modal window will be created
these values.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Handle-the-modal-window-size-tp4656427p4656469.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Handle the modal window size?

2013-02-18 Thread Martin Grigorov
Hi,

The only way I see is to extend (monkey patch) Wicket.Window#resizing()
method. That contribute your own .js file that defines
Wicket.Window.resizing function.
To find the new sizes see the various #onResizeXyz methods


On Mon, Feb 18, 2013 at 10:28 AM, chrome1235 kemal.m...@gmail.com wrote:

 Martin, thanks for your reply.But I need that when the user *resize* the
 modal window *by mouse*. Can I get the new dimensions(changed by mouse). If
 I can get, then i will save it to session. So, modal window will be created
 these values.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Handle-the-modal-window-size-tp4656427p4656469.html
 Sent from the Users forum mailing list archive at Nabble.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 http://jweekend.com/


Re: JBoss RichFaces/AeroGear effort to create cross-framework components

2013-02-18 Thread Martin Grigorov
Hi,

Please send us the links to the docs, code and demos of the initiative.


On Sat, Feb 16, 2013 at 6:37 PM, Ing. Ondřej Žižka zi...@seznam.czwrote:

 Hi everyone,

 RichFaces team has started an effort to make their components available
 for multiple frameworks.
 Currently, the targetted are JSF, GWT/Errai and one I don't remember.
 It would be cool to have Wicket amongst those: Wicket community would get
 a set of highly tested and maintained ajax-enabled components.

 For that, the RichFaces team is looking for experiended Wicket component
 integrator who would help creating a guide how to mount Wicket onto the
 common API of those components.
 Currently, the demo app hosting is down, but I could provide few examples
 of how it works for GWT.

 Anyone interested?

 Regards,
 Ondra

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




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


Re[4]: Forward request to an external filter

2013-02-18 Thread Leonid Bogdanov

Hello, Martin!

    I think such article would be helpful to many others, so if it's not too 
much trouble, please, write about it.

Thank you.


Monday, 18 Feb 2013, 10:25 +02:00 from Martin Grigorov mgrigo...@apache.org:
Hi Leonid,

I have no experience with Apache Shiro.
I can blog about how to use Scribe directly in Wicket if this will help you.


On Mon, Feb 18, 2013 at 10:18 AM, Leonid Bogdanov
 leonid_bogda...@mail.ru wrote:


 Hello, Martin!

 Thank you for your response! Actually I already use Scribe lib, but
 indirectly - through Shiro OAuth plugin.

 Thank you.


 Monday, 18 Feb 2013, 10:06 +02:00 from Martin Grigorov 
  mgrigo...@apache.org :
 Hi,
 
 Wicket doesn't provide an API for internal forwards. Use the Servlet API
 for this.
 
 Also check  https://github.com/fernandezpablo85/scribe-java for OAuth.
 It is
 very simple to use it.
 
 
 On Thu, Feb 14, 2013 at 4:34 PM, Leonid Bogdanov 
  leonid_bogda...@mail.ru wrote:
 
 
  Hello!
 
I'm trying to add OAuth authentication to a Wicket webapp and as a
 part
  of this I need to be able to do server-side forward of a request from
  Wicket to an external filter.
So what is the best way to do this in Wicket? Do I need to throw some
  special exception with an URL to forward to or should do this more
  traditionally with RequestDispatcher.forward()?
 
  Thank you.
 
 
 
 
 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
  http://jWeekend.com   http://jweekend.com/ 
 




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




Re: Submit form before handle onclick

2013-02-18 Thread Gonzalo Aguilar Delgado
Hi Martin, 

Ok. I will take a look to this but I think it's not the right solution. 

Suppose this:
-
PAGE Example|
---
A - This is a form.  | B - This is a form.|
---|


Supppose that you want to process form B with Ajax but you also need the
information the user typed on A. 

How can you do it? With ajax of course?

I will submit A so the model of A gets updated, and after I will submit
B. So B has the model of A and B loaded.

Is there a better way to do it?



El lun, 18-02-2013 a las 10:10 +0200, Martin Grigorov escribió:

 
 Use org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onAfterSubmit
 if you
 want to execute something *after* Form#onSubmit()


Re: Re[4]: Forward request to an external filter

2013-02-18 Thread Martin Grigorov
Please subscribe to the RSS of http://wicketinaction.com/  so you are
notified when I'm ready :-)


On Mon, Feb 18, 2013 at 10:51 AM, Leonid Bogdanov
leonid_bogda...@mail.ruwrote:


 Hello, Martin!

 I think such article would be helpful to many others, so if it's not
 too much trouble, please, write about it.

 Thank you.


 Monday, 18 Feb 2013, 10:25 +02:00 from Martin Grigorov 
 mgrigo...@apache.org:
 Hi Leonid,
 
 I have no experience with Apache Shiro.
 I can blog about how to use Scribe directly in Wicket if this will help
 you.
 
 
 On Mon, Feb 18, 2013 at 10:18 AM, Leonid Bogdanov
  leonid_bogda...@mail.ru wrote:
 
 
  Hello, Martin!
 
  Thank you for your response! Actually I already use Scribe lib, but
  indirectly - through Shiro OAuth plugin.
 
  Thank you.
 
 
  Monday, 18 Feb 2013, 10:06 +02:00 from Martin Grigorov 
   mgrigo...@apache.org :
  Hi,
  
  Wicket doesn't provide an API for internal forwards. Use the Servlet
 API
  for this.
  
  Also check  https://github.com/fernandezpablo85/scribe-java for OAuth.
  It is
  very simple to use it.
  
  
  On Thu, Feb 14, 2013 at 4:34 PM, Leonid Bogdanov 
   leonid_bogda...@mail.ru wrote:
  
  
   Hello!
  
 I'm trying to add OAuth authentication to a Wicket webapp and as a
  part
   of this I need to be able to do server-side forward of a request from
   Wicket to an external filter.
 So what is the best way to do this in Wicket? Do I need to throw
 some
   special exception with an URL to forward to or should do this more
   traditionally with RequestDispatcher.forward()?
  
   Thank you.
  
  
  
  
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
   http://jWeekend.com   http://jweekend.com/ 
  
 
 
 
 
 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com  http://jweekend.com/ 
 




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


Re: Submit form before handle onclick

2013-02-18 Thread Martin Grigorov
Hi,

I think this is not possible if you use two root forms.
You need to submit them by order (first A and then B) to have the values.

You can use nested forms though. B should be inside A.
This way when you submit B Wicket will post all the data (for both A and B)
but will process only form B. The values of the form components of A will
be available thru request.getPostRequestParameters().get(someFromA)


On Mon, Feb 18, 2013 at 10:56 AM, Gonzalo Aguilar Delgado 
gagui...@aguilardelgado.com wrote:

 Hi Martin,

 Ok. I will take a look to this but I think it's not the right solution.

 Suppose this:
 -
 PAGE Example|
 ---
 A - This is a form.  | B - This is a form.|
 ---|


 Supppose that you want to process form B with Ajax but you also need the
 information the user typed on A.

 How can you do it? With ajax of course?

 I will submit A so the model of A gets updated, and after I will submit
 B. So B has the model of A and B loaded.

 Is there a better way to do it?



 El lun, 18-02-2013 a las 10:10 +0200, Martin Grigorov escribió:

 
  Use org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onAfterSubmit
  if you
  want to execute something *after* Form#onSubmit()




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


Re: Why does my HelloWorldPage not work?

2013-02-18 Thread mike.hua
Thank you for your help!
I have changed param-value to myWicket.HelloWorldApplication,and the error
appears yet!
In Server log,I can see the error messages below:
*Exception starting filter HelloWorldApplication
java.lang.NoClassDefFoundError: org/apache/velocity/app/Velocity
at org.apache.wicket.velocity.Initializer.init(Initializer.java:61)
at org.apache.wicket.Application.initInitializers(Application.java:612)
at 
org.apache.wicket.Application.initializeComponents(Application.java:521)
at org.apache.wicket.Application.initApplication(Application.java:817)
at 
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:409)
at 
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:336)
at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at
org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:107)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5312)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException:
org.apache.velocity.app.Velocity
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)*



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656477.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Why does my HelloWorldPage not work?

2013-02-18 Thread Martin Grigorov
Remove wicket-velocity.jar from the dependencies.


On Mon, Feb 18, 2013 at 12:03 PM, mike.hua hz...@sohu.com wrote:

 Thank you for your help!
 I have changed param-value to myWicket.HelloWorldApplication,and the
 error
 appears yet!
 In Server log,I can see the error messages below:
 *Exception starting filter HelloWorldApplication
 java.lang.NoClassDefFoundError: org/apache/velocity/app/Velocity
 at org.apache.wicket.velocity.Initializer.init(Initializer.java:61)
 at
 org.apache.wicket.Application.initInitializers(Application.java:612)
 at
 org.apache.wicket.Application.initializeComponents(Application.java:521)
 at
 org.apache.wicket.Application.initApplication(Application.java:817)
 at
 org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:409)
 at
 org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:336)
 at

 org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
 at

 org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
 at

 org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:107)
 at

 org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
 at

 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5312)
 at
 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at

 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
 at

 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
 at
 java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
 at java.util.concurrent.FutureTask.run(FutureTask.java:166)
 at

 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
 at

 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
 at java.lang.Thread.run(Thread.java:722)
 Caused by: java.lang.ClassNotFoundException:
 org.apache.velocity.app.Velocity
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)*



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656477.html
 Sent from the Users forum mailing list archive at Nabble.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 http://jweekend.com/


Re: Why does my HelloWorldPage not work?

2013-02-18 Thread mike.hua
Is there any solutions without maven?
Because I've never used it,and I am a new Java Web developer!
Before using Java, I have used ASP.NET 2.0 for about 7 years.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656480.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Why does my HelloWorldPage not work?

2013-02-18 Thread mike.hua
Thanks!
I have tried it,and the error still happens!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656481.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Why does my HelloWorldPage not work?

2013-02-18 Thread mike.hua
Thanks!
I have tried it,and the error still happens! 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656482.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Submit form before handle onclick

2013-02-18 Thread Gonzalo Aguilar Delgado
Hi Martin, 

Thank you for your answer. 

What about doing like google and others? I mean save (submit) on lost
focus... So the model will get updated every time you leave a field.

Any good references?

thank you.

El lun, 18-02-2013 a las 11:02 +0200, Martin Grigorov escribió:

 Hi,
 
 I think this is not possible if you use two root forms.
 You need to submit them by order (first A and then B) to have the values.
 
 You can use nested forms though. B should be inside A.
 This way when you submit B Wicket will post all the data (for both A and B)
 but will process only form B. The values of the form components of A will
 be available thru request.getPostRequestParameters().get(someFromA)
 
 
 On Mon, Feb 18, 2013 at 10:56 AM, Gonzalo Aguilar Delgado 
 gagui...@aguilardelgado.com wrote:
 
  Hi Martin,
 
  Ok. I will take a look to this but I think it's not the right solution.
 
  Suppose this:
  -
  PAGE Example|
  ---
  A - This is a form.  | B - This is a form.|
  ---|
 
 
  Supppose that you want to process form B with Ajax but you also need the
  information the user typed on A.
 
  How can you do it? With ajax of course?
 
  I will submit A so the model of A gets updated, and after I will submit
  B. So B has the model of A and B loaded.
 
  Is there a better way to do it?
 
 
 
  El lun, 18-02-2013 a las 10:10 +0200, Martin Grigorov escribió:
 
  
   Use org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onAfterSubmit
   if you
   want to execute something *after* Form#onSubmit()
 
 
 
 


Re: Submit form before handle onclick

2013-02-18 Thread Ernesto Reinaldo Barreiro
Hi,

On Mon, Feb 18, 2013 at 11:45 AM, Gonzalo Aguilar Delgado 
gagui...@aguilardelgado.com wrote:

 Hi Martin,

 Thank you for your answer.

 What about doing like google and others? I mean save (submit) on lost
 focus... So the model will get updated every time you leave a field.


Isn't this a matter of just attaching an AjaxFormComponentUpdatingBehavior
to on blur event?


 Any good references?

 thank you.

 El lun, 18-02-2013 a las 11:02 +0200, Martin Grigorov escribió:

  Hi,
 
  I think this is not possible if you use two root forms.
  You need to submit them by order (first A and then B) to have the values.
 
  You can use nested forms though. B should be inside A.
  This way when you submit B Wicket will post all the data (for both A and
 B)
  but will process only form B. The values of the form components of A will
  be available thru request.getPostRequestParameters().get(someFromA)
 
 
  On Mon, Feb 18, 2013 at 10:56 AM, Gonzalo Aguilar Delgado 
  gagui...@aguilardelgado.com wrote:
 
   Hi Martin,
  
   Ok. I will take a look to this but I think it's not the right solution.
  
   Suppose this:
   -
   PAGE Example|
   ---
   A - This is a form.  | B - This is a form.|
   ---|
  
  
   Supppose that you want to process form B with Ajax but you also need
 the
   information the user typed on A.
  
   How can you do it? With ajax of course?
  
   I will submit A so the model of A gets updated, and after I will submit
   B. So B has the model of A and B loaded.
  
   Is there a better way to do it?
  
  
  
   El lun, 18-02-2013 a las 10:10 +0200, Martin Grigorov escribió:
  
   
Use org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onAfterSubmit
if you
want to execute something *after* Form#onSubmit()
  
 
 
 




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ http://antiliasoft.com/antilia


Re: Submit form before handle onclick

2013-02-18 Thread Martin Grigorov
I thought you don't want form A to be submitted and its model updated.
Otherwise why you have two forms ?

Otherwise use what Ernesto suggested - AjaxFormComponentUpdatingBehavior
for each 'required' component of form A.


On Mon, Feb 18, 2013 at 12:50 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi,

 On Mon, Feb 18, 2013 at 11:45 AM, Gonzalo Aguilar Delgado 
 gagui...@aguilardelgado.com wrote:

  Hi Martin,
 
  Thank you for your answer.
 
  What about doing like google and others? I mean save (submit) on lost
  focus... So the model will get updated every time you leave a field.
 
 
 Isn't this a matter of just attaching an AjaxFormComponentUpdatingBehavior
 to on blur event?


  Any good references?
 
  thank you.
 
  El lun, 18-02-2013 a las 11:02 +0200, Martin Grigorov escribió:
 
   Hi,
  
   I think this is not possible if you use two root forms.
   You need to submit them by order (first A and then B) to have the
 values.
  
   You can use nested forms though. B should be inside A.
   This way when you submit B Wicket will post all the data (for both A
 and
  B)
   but will process only form B. The values of the form components of A
 will
   be available thru request.getPostRequestParameters().get(someFromA)
  
  
   On Mon, Feb 18, 2013 at 10:56 AM, Gonzalo Aguilar Delgado 
   gagui...@aguilardelgado.com wrote:
  
Hi Martin,
   
Ok. I will take a look to this but I think it's not the right
 solution.
   
Suppose this:
-
PAGE Example|
---
A - This is a form.  | B - This is a form.|
---|
   
   
Supppose that you want to process form B with Ajax but you also need
  the
information the user typed on A.
   
How can you do it? With ajax of course?
   
I will submit A so the model of A gets updated, and after I will
 submit
B. So B has the model of A and B loaded.
   
Is there a better way to do it?
   
   
   
El lun, 18-02-2013 a las 10:10 +0200, Martin Grigorov escribió:
   

 Use
 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onAfterSubmit
 if you
 want to execute something *after* Form#onSubmit()
   
  
  
  
 



 --
 Regards - Ernesto Reinaldo Barreiro
 Antilia Soft
 http://antiliasoft.com/ http://antiliasoft.com/antilia




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


Re: Why does my HelloWorldPage not work?

2013-02-18 Thread mike.hua
Thanks a lot!
But now there are some errors in Tomcat server or GlassFish server.
*In Tomcat:*
Exception starting filter HelloWorldApplication
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:161)
at
org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:730)
at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:263)
at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:646)
at
org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:226)
at org.apache.velocity.app.Velocity.init(Velocity.java:97)
at org.apache.wicket.velocity.Initializer.init(Initializer.java:61)
at org.apache.wicket.Application.initInitializers(Application.java:612)
at 
org.apache.wicket.Application.initializeComponents(Application.java:521)
at org.apache.wicket.Application.initApplication(Application.java:817)
at 
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:409)
at 
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:336)
at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at
org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:107)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5312)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.lang.StringUtils
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)

*In GlassFish server log:*
WebModule[/MyFirstWicket]PWC1270: Exception starting filter
HelloWorldApplication
java.lang.NoSuchMethodError:
org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
at
org.apache.wicket.protocol.http.WicketFilter.clinit(WicketFilter.java:64)
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
com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:307)
at
com.sun.enterprise.web.WebContainer.createFilterInstance(WebContainer.java:745)
at
com.sun.enterprise.web.WebModule.createFilterInstance(WebModule.java:1972)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:253)
at
org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:120)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at 

Re: Why does my HelloWorldPage not work?

2013-02-18 Thread Ernesto Reinaldo Barreiro
Hi,


On Mon, Feb 18, 2013 at 12:28 PM, mike.hua hz...@sohu.com wrote:

 Thanks a lot!
 But now there are some errors in Tomcat server or GlassFish server.
 *In Tomcat:*
 Exception starting filter HelloWorldApplication
 java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
 at

 org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:161)
 at

 org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:730)
 at
 org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:263)
 at
 org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:646)
 at

 org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:226)
 at org.apache.velocity.app.Velocity.init(Velocity.java:97)
 at org.apache.wicket.velocity.Initializer.init(Initializer.java:61)
 at
 org.apache.wicket.Application.initInitializers(Application.java:612)
 at
 org.apache.wicket.Application.initializeComponents(Application.java:521)
 at
 org.apache.wicket.Application.initApplication(Application.java:817)
 at
 org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:409)
 at
 org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:336)
 at

 org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
 at

 org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
 at

 org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:107)
 at

 org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
 at

 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5312)
 at
 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at

 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
 at

 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
 at
 java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
 at java.util.concurrent.FutureTask.run(FutureTask.java:166)
 at

 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
 at

 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
 at java.lang.Thread.run(Thread.java:722)
 Caused by: java.lang.ClassNotFoundException:
 org.apache.commons.lang.StringUtils
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
 at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)


Those errors are not exactly wicket related... It is just that you are
including jars that need other jars to function properly. Either you
include those jar manually on class path (aka WEB-INF/lib) or your
application start using some dependency management tool.


 *In GlassFish server log:*
 WebModule[/MyFirstWicket]PWC1270: Exception starting filter
 HelloWorldApplication
 java.lang.NoSuchMethodError:

 org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
 at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
 at
 org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
 at
 org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
 at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
 at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
 at
 org.apache.wicket.protocol.http.WicketFilter.clinit(WicketFilter.java:64)
 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

 com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:307)
 at

 com.sun.enterprise.web.WebContainer.createFilterInstance(WebContainer.java:745)
 at
 com.sun.enterprise.web.WebModule.createFilterInstance(WebModule.java:1972)
 at

 org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:253)
 at

 org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:120)
 at

 org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
 at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
 at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
 at

 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
 at
 

Re: Why does my HelloWorldPage not work?

2013-02-18 Thread Martin Grigorov
I think you don't need Velocity for a Hello World application. You also
mentioned that you are a beginner ...
Just remove wicket-velocity.jar and velocity.jar from your app.


On Mon, Feb 18, 2013 at 1:37 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi,


 On Mon, Feb 18, 2013 at 12:28 PM, mike.hua hz...@sohu.com wrote:

  Thanks a lot!
  But now there are some errors in Tomcat server or GlassFish server.
  *In Tomcat:*
  Exception starting filter HelloWorldApplication
  java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
  at
 
 
 org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:161)
  at
 
 
 org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:730)
  at
 
 org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:263)
  at
 
 org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:646)
  at
 
 
 org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:226)
  at org.apache.velocity.app.Velocity.init(Velocity.java:97)
  at
 org.apache.wicket.velocity.Initializer.init(Initializer.java:61)
  at
  org.apache.wicket.Application.initInitializers(Application.java:612)
  at
  org.apache.wicket.Application.initializeComponents(Application.java:521)
  at
  org.apache.wicket.Application.initApplication(Application.java:817)
  at
  org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:409)
  at
  org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:336)
  at
 
 
 org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
  at
 
 
 org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
  at
 
 
 org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:107)
  at
 
 
 org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
  at
 
 
 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5312)
  at
  org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at
 
 
 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
  at
 
 
 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
  at
  java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
  at java.util.concurrent.FutureTask.run(FutureTask.java:166)
  at
 
 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
  at
 
 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
  at java.lang.Thread.run(Thread.java:722)
  Caused by: java.lang.ClassNotFoundException:
  org.apache.commons.lang.StringUtils
  at
 
 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
  at
 
 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
 
 
 Those errors are not exactly wicket related... It is just that you are
 including jars that need other jars to function properly. Either you
 include those jar manually on class path (aka WEB-INF/lib) or your
 application start using some dependency management tool.


  *In GlassFish server log:*
  WebModule[/MyFirstWicket]PWC1270: Exception starting filter
  HelloWorldApplication
  java.lang.NoSuchMethodError:
 
 
 org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
  at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
  at
  org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
  at
  org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
  at
 
 org.apache.wicket.protocol.http.WicketFilter.clinit(WicketFilter.java:64)
  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
 
 
 com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:307)
  at
 
 
 com.sun.enterprise.web.WebContainer.createFilterInstance(WebContainer.java:745)
  at
 
 com.sun.enterprise.web.WebModule.createFilterInstance(WebModule.java:1972)
  at
 
 
 org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:253)
  at
 
 
 

Re: Why does my HelloWorldPage not work?

2013-02-18 Thread mike.hua
Thank you!
But the HelloWorld demo is very simple,and it doesn't need some extra jar
files!
When I added the velocity-1.7.jar file,the above errors has happened.

So I don't know what to do.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656489.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Why does my HelloWorldPage not work?

2013-02-18 Thread Ernesto Reinaldo Barreiro
Just delete wicket-velocity.jar as Martin suggested.

On Mon, Feb 18, 2013 at 12:53 PM, mike.hua hz...@sohu.com wrote:

 Thank you!
 But the HelloWorld demo is very simple,and it doesn't need some extra jar
 files!
 When I added the velocity-1.7.jar file,the above errors has happened.

 So I don't know what to do.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656489.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ http://antiliasoft.com/antilia


Re: Why does my HelloWorldPage not work?

2013-02-18 Thread Ernesto Reinaldo Barreiro
http://commons.apache.org/lang/

On Mon, Feb 18, 2013 at 1:19 PM, mike.hua hz...@sohu.com wrote:

 java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils is
 continued after remove velocity.jar!

 Thank you for your continous help!



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656492.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ http://antiliasoft.com/antilia


Re: Why does my HelloWorldPage not work?

2013-02-18 Thread Martin Grigorov
Please paste the code of you HelloWorld page and the list of files in
WEB-INF/lib in the produced .war file.


On Mon, Feb 18, 2013 at 2:20 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 http://commons.apache.org/lang/

 On Mon, Feb 18, 2013 at 1:19 PM, mike.hua hz...@sohu.com wrote:

  java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils is
  continued after remove velocity.jar!
 
  Thank you for your continous help!
 
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656492.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 Regards - Ernesto Reinaldo Barreiro
 Antilia Soft
 http://antiliasoft.com/ http://antiliasoft.com/antilia




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


Re: Why does my HelloWorldPage not work?

2013-02-18 Thread mike.hua
http://apache-wicket.1842946.n4.nabble.com/file/n4656497/WicketError.png 
The code is in the front of the question!

Thanks!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656497.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Why does my HelloWorldPage not work?

2013-02-18 Thread mike.hua
Paste the source code:

*HelloWorldPage.html:*

*HelloWorldPage.java:*
package myWicket;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;

public class HelloWorldPage extends WebPage {
private static final long serialVersionUID = 1L;

public HelloWorldPage() {
add(new Label(message, Hello World using Wicket!!));
}
}

*HelloWorldApplication.java:*
package myWicket;

import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;

public class HelloWorldApplication extends WebApplication {
public HelloWorldApplication() {
}

@Override
public Class? extends Page getHomePage() {
return HelloWorldPage.class;
}
}

*web.xml:*
?xml version=1.0 encoding=UTF-8?
web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd;
id=WebApp_ID version=3.0
display-nameMyFirstWicket/display-name
filter
filter-nameHelloWorldApplication/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationClassName/param-name

param-valuemyWicket.HelloWorldApplication/param-value
/init-param
/filter
filter-mapping
filter-nameHelloWorldApplication/filter-name
url-pattern/*/url-pattern
/filter-mapping
welcome-file-list
welcome-fileindex.html/welcome-file
welcome-fileindex.htm/welcome-file
welcome-fileindex.jsp/welcome-file
welcome-filedefault.html/welcome-file
welcome-filedefault.htm/welcome-file
welcome-filedefault.jsp/welcome-file
/welcome-file-list
/web-app



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656498.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Why does my HelloWorldPage not work?

2013-02-18 Thread Ernesto Reinaldo Barreiro
For Hollo World app you only need wicket jars.

wicket-core-6.5.0.jar
wicket-util-6.5.0.jar
wicket-request-6.5.0.jar


On Mon, Feb 18, 2013 at 1:36 PM, mike.hua hz...@sohu.com wrote:

 Paste the source code:

 *HelloWorldPage.html:*

 *HelloWorldPage.java:*
 package myWicket;

 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.basic.Label;

 public class HelloWorldPage extends WebPage {
 private static final long serialVersionUID = 1L;

 public HelloWorldPage() {
 add(new Label(message, Hello World using Wicket!!));
 }
 }

 *HelloWorldApplication.java:*
 package myWicket;

 import org.apache.wicket.Page;
 import org.apache.wicket.protocol.http.WebApplication;

 public class HelloWorldApplication extends WebApplication {
 public HelloWorldApplication() {
 }

 @Override
 public Class? extends Page getHomePage() {
 return HelloWorldPage.class;
 }
 }

 *web.xml:*
 ?xml version=1.0 encoding=UTF-8?
 web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns=http://java.sun.com/xml/ns/javaee;
 xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
 xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd;
 id=WebApp_ID version=3.0
 display-nameMyFirstWicket/display-name
 filter
 filter-nameHelloWorldApplication/filter-name

 filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
 init-param
 param-nameapplicationClassName/param-name

 param-valuemyWicket.HelloWorldApplication/param-value
 /init-param
 /filter
 filter-mapping
 filter-nameHelloWorldApplication/filter-name
 url-pattern/*/url-pattern
 /filter-mapping
 welcome-file-list
 welcome-fileindex.html/welcome-file
 welcome-fileindex.htm/welcome-file
 welcome-fileindex.jsp/welcome-file
 welcome-filedefault.html/welcome-file
 welcome-filedefault.htm/welcome-file
 welcome-filedefault.jsp/welcome-file
 /welcome-file-list
 /web-app



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656498.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ http://antiliasoft.com/antilia


Re: Another Wicket 6 migration issue: drag and drop (so far done with wiquery)

2013-02-18 Thread Martin Dietze
On Fri, February 15, 2013, Emond Papegaaij wrote:

 DroppableBehavior is the replacement of DroppableAjaxBehavior. You use it
 like this:
 
 final DroppableBehavior droppableBehavior = new DroppableBehavior();
 droppableBehavior.setDropEvent( new AjaxDropCallback() {
 protected void drop(AjaxRequestTarget target, Component source,
 Component dropped) {
 // [...]
 }
 } );
 droppableBehavior.setAccept( new DroppableAccept( .fileItem ) );
 droppableBehavior.setHoverClass( dropHover );
 add( droppableBehavior );

Thank you very much! I just could not find any example from
which to find out how to use it...

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
Albert Camus wrote that the only serious question is whether to kill yourself
or not.  Tom Robbins wrote that the only serious question is whether time has
a beginning and an end.  Camus clearly got up on the wrong side of bed, and
Robbins must have forgotten to set the alarm.  -- Tom Robbins

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



Re: JBoss RichFaces/AeroGear effort to create cross-framework components

2013-02-18 Thread hantsy
Hi, it will be included in Richfaces5? I can not find the info from the
Richfaces project page.

On 2/18/2013 16:40, Martin Grigorov wrote:
 Hi,

 Please send us the links to the docs, code and demos of the initiative.


 On Sat, Feb 16, 2013 at 6:37 PM, Ing. Ondřej Žižka zi...@seznam.czwrote:

 Hi everyone,

 RichFaces team has started an effort to make their components available
 for multiple frameworks.
 Currently, the targetted are JSF, GWT/Errai and one I don't remember.
 It would be cool to have Wicket amongst those: Wicket community would get
 a set of highly tested and maintained ajax-enabled components.

 For that, the RichFaces team is looking for experiended Wicket component
 integrator who would help creating a guide how to mount Wicket onto the
 common API of those components.
 Currently, the demo app hosting is down, but I could provide few examples
 of how it works for GWT.

 Anyone interested?

 Regards,
 Ondra

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@wicket.**apache.orgusers-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: Why does my HelloWorldPage not work?

2013-02-18 Thread Kees van Dieren
Add
http://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jarto
you WEB-INF/lib

Best regards / Met vriendelijke groet,

Kees van Dieren
Squins IT Solutions BV
Oranjestraat 30
2983 HS Ridderkerk
The Netherlands
Mobile: +31 (0)6 30413841
www.squins.com
Chamber of commerce Rotterdam: 24435103


2013/2/18 mike.hua hz...@sohu.com

 java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils is
 continued after remove velocity.jar!

 Thank you for your continous help!



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656492.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Why does my HelloWorldPage not work?

2013-02-18 Thread Martin Grigorov
Do not add anything!

Just remove all jars but wicket-core.jar, wicket-util.jar and
wicket-request.jar.


On Mon, Feb 18, 2013 at 3:31 PM, Kees van Dieren i...@squins.com wrote:

 Add

 http://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jarto
 you WEB-INF/lib

 Best regards / Met vriendelijke groet,

 Kees van Dieren
 Squins IT Solutions BV
 Oranjestraat 30
 2983 HS Ridderkerk
 The Netherlands
 Mobile: +31 (0)6 30413841
 www.squins.com
 Chamber of commerce Rotterdam: 24435103


 2013/2/18 mike.hua hz...@sohu.com

  java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils is
  continued after remove velocity.jar!
 
  Thank you for your continous help!
 
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656492.html
  Sent from the Users forum mailing list archive at Nabble.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 http://jweekend.com/


Re: Several Form onSubmit, is it possible add via AbstractBehavior?

2013-02-18 Thread Paul Bors
As per the JavaDocs:
http://ci.apache.org/projects/wicket/apidocs/1.5.x/org/apache/wicket/ajax/markup/html/form/AjaxFallbackButton.html#onSubmit(org.apache.wicket.ajax.AjaxRequestTarget,
org.apache.wicket.markup.html.form.Form)
Callback for the onClick event. If ajax failed and this event was generated
via a normal submission, the target argument will be null

*Parameters:*target - ajax target if this linked was invoked using ajax,
null otherwise
I belive your target is null because you are using a fallback button and
you might have JavaScript turned off in your browser?

~ Thank you,
   Paul Bors
On Fri, Feb 15, 2013 at 5:42 AM, Alex avat...@yahoo.com wrote:

 As I understand the only way to catch the form's onSubmit is by analyze
 form
 components validation which is performed by form submitting. And if
 validation is successful then form submit will be done for sure. Am I
 correct understand?

 Trying to find workaround for this issue,in MyCustomBehavior I found form's
 button and added AjaxEvenBehavior(onclick) to it. Strangely but
 form.getDefaultButton() returned null and the only way to get form's Button
 component is the traversing over all the form components and finding a
 button component (not sure if it best way). So when I clicked the button
 the
 AjaxEventBehavior.onEvent occurs (in MyCustomBehavior) and next
 AjaxFallbackButton.onSubmit on main form had invoked. But I found that the
 target parameter is null in main onSubmit handler of form's
 AjaxFallbackButton. What wrong in this case? Why the target is null in
 form's buton handler and not null in the form Behavior's button handler.
 This is the same button in fact. In the form it have onSubmit handler, and
 in MyCustomBehavior it have onEvent handler. A piece of code is given
 below...
 Thanks a lot for help.

 public class MyCustomBehavior extends AbstractBehavior {
 ..
@Override
 public void onConfigure(Component component) {
 // this.form.getDefaultButton() - return null in fact (why)

 Iterator? extends Component iter = form.iterator();
 while (iter.hasNext()) {
 FormComponent? fc =
 (FormComponent?)iter.next();
 if (fc.isEnabled()  (fc instanceof Button)) {
 fc.add(new AjaxEventBehavior(onclick) {
 private static final long
 serialVersionUID = 1L;

 @Override
 protected void
 onEvent(AjaxRequestTarget target) {
 // here target is not null

 System.out.println(clicked );
 }
 });
 };
  } // end of while
 } // end of onConfigure
 
 }

 // Main page
 
 form.add(new AjaxFallbackButton(submit,form) {
  protected void onSubmit(AjaxRequestTarget target, Form?
 aForm) {
 // here target is null (why?)
.
   // some main actions for form submit...
  }
 });
 .
 form.add(new MyCustomBehavior(feedback));
 ...
 // End of main page



 -
 Best wishes,
 Alex.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Several-Form-onSubmit-is-it-possible-add-via-AbstractBehavior-tp4656347p4656393.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Redirect to the HomePage on newSession

2013-02-18 Thread Paul Bors
You can always throw a RestartResponseAtInterceptPageException(Page) and
let Wicket do the redirect for you.

~ Thank you,
   Paul Bors

On Fri, Feb 15, 2013 at 6:08 AM, vov vov...@mail.ru wrote:

 Found good solution:

 @Override
   protected void init()
   {
  getRootRequestMapperAsCompound().add(new
 LoginHomePageMapper(getHomePage()));
   }

 private static class LoginHomePageMapper extends MountedMapper
   {
 public LoginHomePageMapper(Class? extends IRequestablePage pageClass)
 {
   super(/, pageClass);
 }

 @Override
 public int getCompatibilityScore(Request request)
 {
   MySession session = (MySession) Session.get();
   if (session.isNewCreated())
   {
 session.setNewCreated(false);
 return Integer.MAX_VALUE;
   }

   return Integer.MIN_VALUE;
 }

 @Override
 protected UrlInfo parseRequest(Request request)
 {
   return new UrlInfo(null, getContext().getHomePageClass(),
 newPageParameters());
 }
   }

 Thank you all for your efforts



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Redirect-to-the-HomePage-on-newSession-tp4656365p4656395.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Migration issue: page that writes binary data to the response

2013-02-18 Thread Martin Dietze
In the project I'm currently porting from 1.4.x to 6.6.0 I've
run into an issue with Wicket pages which stream binary data
into the WebResponse (e.g. ZIP archives created on the fly).

First thing I found was that obviously I *have* to create
templates for these pages even though they are not going to be
used for anything. 

The second thing is more serious: when writing to the response I
get an IllegalStateException as the template code has already
been written to it. This can be circumvented by calling
Response.reset() before Response.write() in my code. However in
development mode I still get an ISE as in Page.onAfterRender()
there's this code here:

| if (getApplication().getDebugSettings().isOutputMarkupContainerClassName())
| {
| String className = Classes.name(getClass());
| getResponse().write(!-- Page Class );
| getResponse().write(className);
| getResponse().write( END --\n);
| }

}
Now of course I can write:

| @Override
| protected void onAfterRender() {
|   try { super.onAfterRender(); } catch (IllegalStateException e) { }
| }

... but I guess we agree that while this works it is far from nice.

I am not sure if I understand correctly what the above code is
trying to tell me. Does it mean that I am simply not supposed to
deliver my ZIP files by a Wicket page that way? 

If with today's Wicket version there's a different or even better
way to do this, which one would that be?

Else, would there be any harm in making the Page class more
friendly to this kind of use, by e.g. putting the above
if-statement into an overridable method and adding an option to
the Component class to tell it that there's no markup for it and
it should simply not expect any?

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
My Hovercraft is full of eels!

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



Re: Migration issue: page that writes binary data to the response

2013-02-18 Thread Carl-Eric Menzel
I would simply do this in a Resource (e.g. subclass AbstractResource)
rather than in a page. Resources are for binary data, Pages are for
markup. That way you don't have to mess around in any way with the
response or anything like that.

Is there a particular reason you're using a page?

Carl-Eric

On Mon, 18 Feb 2013 17:55:37 +0100
Martin Dietze d...@fh-wedel.de wrote:

 In the project I'm currently porting from 1.4.x to 6.6.0 I've
 run into an issue with Wicket pages which stream binary data
 into the WebResponse (e.g. ZIP archives created on the fly).
 
 First thing I found was that obviously I *have* to create
 templates for these pages even though they are not going to be
 used for anything. 
 
 The second thing is more serious: when writing to the response I
 get an IllegalStateException as the template code has already
 been written to it. This can be circumvented by calling
 Response.reset() before Response.write() in my code. However in
 development mode I still get an ISE as in Page.onAfterRender()
 there's this code here:
 
 | if
 (getApplication().getDebugSettings().isOutputMarkupContainerClassName())
 | { | String className = Classes.name(getClass());
 | getResponse().write(!-- Page Class );
 | getResponse().write(className);
 | getResponse().write( END --\n);
 | }
   
   }
 Now of course I can write:
 
 | @Override
 | protected void onAfterRender() {
 |   try { super.onAfterRender(); } catch (IllegalStateException e) { }
 | }
 
 ... but I guess we agree that while this works it is far from nice.
 
 I am not sure if I understand correctly what the above code is
 trying to tell me. Does it mean that I am simply not supposed to
 deliver my ZIP files by a Wicket page that way? 
 
 If with today's Wicket version there's a different or even better
 way to do this, which one would that be?
 
 Else, would there be any harm in making the Page class more
 friendly to this kind of use, by e.g. putting the above
 if-statement into an overridable method and adding an option to
 the Component class to tell it that there's no markup for it and
 it should simply not expect any?
 
 Cheers,
 
 M'bert
 


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



[ANN] wicketstuff-lazymodel

2013-02-18 Thread Sven Meier

Hi all,

I've added a new module to wicketstuff:

LazyModel offers lazy evaluation of method invocations. It takes the 
best from present solutions (safemodel and modelfactory) and improves on 
reflection to support:


* arbitrary parameters
* generics
* collections
* interfaces

Two simple examples:

IModelString model = model(from(a).getB().getStrings().get(key));

new LazyColumnA, B(header, from(A.class).getB());

Read more here:

https://github.com/wicketstuff/core/wiki/LazyModel

Have fun
Sven

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



Fundamental forms/models issue

2013-02-18 Thread Michael Chandler
Good morning/afternoon everyone.

I'm having a basic problem fully deciphering how to best manage my forms, 
specifically related to Models that are attached to forms.  Since a Wicket 
WebPage has it's constructor invoked only one time in the application 
lifecycle, I'm failing to fully understand how to present a form that has a 
model bound to it without inadvertently sharing that instance of the Model with 
every user of the application.  It seems like a fundamental issue that I'm 
failing to fully grasp and could use some input.

As an example, I have the following in my constructor:

LoadableDetachableModelJob jobModel = new LoadableDetachableModelJob() {

 private static final long serialVersionUID = 1L;

 @Override
 protected Job load() {
   Job job = (Job) EntityFactory.getInstance().getBean(job);

   // if we're editing an existing job, load the object
   if (jobId = 1) {
job.load(jobId);
   }

   return job;
 }

};

I later create a form and after adding it in my constructor, bind the model to 
it as follows:

jobForm.setModel(new CompoundPropertyModelJob(jobModel));

As you can imagine, every user session from this point on now has that instance 
of a Job object bound to that form due to these declarations being in the page 
constructor.  I have come a long way on my own, but I'm at a point where I 
clearly do not have a full grasp of how to best approach this.  I suspect I can 
potentially override an instance of a Model's getObject() method for more 
dynamic behavior, but I'm concerned about writing code that becomes too verbose 
when perhaps there's a better/tighter way to handle this.  Can anyone advise me?

Many thanks!

Mike Chandler



Re: Migration issue: page that writes binary data to the response

2013-02-18 Thread Martin Dietze
On Mon, February 18, 2013, Carl-Eric Menzel wrote:

 Is there a particular reason you're using a page?

One - unfortunately - big reason: it's legacy code (most of
which I did not even write myself). The Wicket upgrade is badly
needed for browser compatibiy, however I don't want to change
code if it's not absolutely necessary. 

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
Man moechte ja lieber Auslaender sein als gieriges kleines Inlaenderschwein,
doch wo das eine nicht geht, da faengt das andere an, und das Problem ist,
dass man wo man ist nichts anderes sein kann...

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



Re: Fundamental forms/models issue

2013-02-18 Thread Carl-Eric Menzel
On Mon, 18 Feb 2013 17:47:16 +
Michael Chandler michael.chand...@onassignment.com wrote:

 Good morning/afternoon everyone.
 
 I'm having a basic problem fully deciphering how to best manage my
 forms, specifically related to Models that are attached to forms.
 Since a Wicket WebPage has it's constructor invoked only one time in
 the application lifecycle, I'm failing to fully understand how to
 present a form that has a model bound to it without inadvertently
 sharing that instance of the Model with every user of the
 application.  It seems like a fundamental issue that I'm failing to
 fully grasp and could use some input.

There is the mistake: Page instances are *not* shared. Every user has
their own instances. There can be plenty of instances of any page at
any given time.

Pages get constructed any time *you* do it (by calling new MyPage(...))
or Wicket does it (when the user first gets to a bookmarkable page,
Wicket will construct a fresh instance by using either the no-arg
constructor or the PageParameters constructor).

Carl-Eric

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



Re: Fundamental forms/models issue

2013-02-18 Thread Sven Meier

Since a Wicket WebPage has it's constructor invoked only one time in the 
application lifecycle


Usually a new page instance is created each time you visit a bookmarkable url. 
WebPages are never shared between clients.

Sven


On 02/18/2013 06:47 PM, Michael Chandler wrote:

Good morning/afternoon everyone.

I'm having a basic problem fully deciphering how to best manage my forms, 
specifically related to Models that are attached to forms.  Since a Wicket 
WebPage has it's constructor invoked only one time in the application 
lifecycle, I'm failing to fully understand how to present a form that has a 
model bound to it without inadvertently sharing that instance of the Model with 
every user of the application.  It seems like a fundamental issue that I'm 
failing to fully grasp and could use some input.

As an example, I have the following in my constructor:

LoadableDetachableModelJob jobModel = new LoadableDetachableModelJob() {

  private static final long serialVersionUID = 1L;

  @Override
  protected Job load() {
Job job = (Job) EntityFactory.getInstance().getBean(job);

// if we're editing an existing job, load the object
if (jobId = 1) {
 job.load(jobId);
}

return job;
  }

};

I later create a form and after adding it in my constructor, bind the model to 
it as follows:

jobForm.setModel(new CompoundPropertyModelJob(jobModel));

As you can imagine, every user session from this point on now has that instance 
of a Job object bound to that form due to these declarations being in the page 
constructor.  I have come a long way on my own, but I'm at a point where I 
clearly do not have a full grasp of how to best approach this.  I suspect I can 
potentially override an instance of a Model's getObject() method for more 
dynamic behavior, but I'm concerned about writing code that becomes too verbose 
when perhaps there's a better/tighter way to handle this.  Can anyone advise me?

Many thanks!

Mike Chandler





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



Re: Fundamental forms/models issue

2013-02-18 Thread Paul Bors
What are you really trying to accomplish here?



I think you're on the right path only one thing I would mention, the page
constructor is not called only once per application life cycle. Same page
can be constructed multiple times if you have a link going to that page
and you calll setResponsePage(new MyPage()).



More on detachable models:

https://cwiki.apache.org/WICKET/detachable-models.html



~ Thank you,

   Paul Bors



On Mon, Feb 18, 2013 at 12:47 PM, Michael Chandler 
michael.chand...@onassignment.com wrote:

 Good morning/afternoon everyone.

 I'm having a basic problem fully deciphering how to best manage my forms,
 specifically related to Models that are attached to forms.  Since a Wicket
 WebPage has it's constructor invoked only one time in the application
 lifecycle, I'm failing to fully understand how to present a form that has a
 model bound to it without inadvertently sharing that instance of the Model
 with every user of the application.  It seems like a fundamental issue that
 I'm failing to fully grasp and could use some input.

 As an example, I have the following in my constructor:

 LoadableDetachableModelJob jobModel = new LoadableDetachableModelJob()
 {

  private static final long serialVersionUID = 1L;

  @Override
  protected Job load() {
Job job = (Job) EntityFactory.getInstance().getBean(job);

// if we're editing an existing job, load the object
if (jobId = 1) {
 job.load(jobId);
}

return job;
  }

 };

 I later create a form and after adding it in my constructor, bind the
 model to it as follows:

 jobForm.setModel(new CompoundPropertyModelJob(jobModel));

 As you can imagine, every user session from this point on now has that
 instance of a Job object bound to that form due to these declarations being
 in the page constructor.  I have come a long way on my own, but I'm at a
 point where I clearly do not have a full grasp of how to best approach
 this.  I suspect I can potentially override an instance of a Model's
 getObject() method for more dynamic behavior, but I'm concerned about
 writing code that becomes too verbose when perhaps there's a better/tighter
 way to handle this.  Can anyone advise me?

 Many thanks!

 Mike Chandler




Re: how to modify internal JavascriptResourceReference packaged with component

2013-02-18 Thread evan

 This is improved in Wicket 6.
 You can use
 org.apache.wicket.protocol.http.WebApplication#addResourceReplacement for
 exactly this use case.
 See http://wicketinaction.com/2012/07/wicket-6-resource-management/
 You are recommended to upgrade your application.


Nice - the addResourceReplacement is great.  Thanks Martin - I will
try to upgrade the application soon.  In the meantime, I will override
the necessary methods in the class, as per Francois' suggestion.



if the question is how to modify internal JavascriptResourceReference
packaged with component
 I will just override
 @Override
 public void renderHead(IHeaderResponse response)
 {
 // initialize the javascript library
 response.render(JavaScriptHeaderItem.forReference(JS));
 response.render(OnDomReadyHeaderItem.forScript(new 
 MultiSelector(' + getInputName() +
 ', document.getElementById(' + 
 container.getMarkupId() + '),  + max + ,' +
 getString(org.apache.wicket.mfu.delete) + 
 ').addElement(document.getElementById(' +
 upload.getMarkupId() + '));));
 }
 Max is the max number of files a user can upload.
 container.getMarkupId() is container
 upload.getMarkupId() is upload



Francois, I'm sorry to belabor this question - but I just want to make
sure I'm not missing something still.  I think I understand what to do
now and it works - I was just pointing out that if I extend the
MultiFileUploadField class, it is not enough to only override that one
method, because the reference to those 3 variables in my overridden
method would be trying to reference private members from the super
class and won't be allowed.  So, I just need to also create a new
version of the variables in the extended class, and override the
constructors in which they are defined, and any other methods in which
they are referenced.  Were you saying in your last response that this
is not necessary, for some reason that I'm still missing?  In any
case, doing it this way works and is fine as a temporary solution
until I upgrade and can use the addResourceReplacement approach.
Thanks again for all the help!

Best,
-Evan




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-modify-internal-JavascriptResourceReference-packaged-with-component-tp4656344p4656516.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: Fundamental forms/models issue

2013-02-18 Thread Michael Chandler
Oh my gosh, Paul.  You just nailed my problem I think.

I'm doing this:

setResponsePage(MyPage.class);

Instead of this:

setResponsePage(new MyPage());

Thanks for the link.  Clearly, I have more reading to do!

Thanks all!

Mike

-Original Message-
From: Paul Bors [mailto:p...@bors.ws] 
Sent: Monday, February 18, 2013 10:08 AM
To: users@wicket.apache.org
Subject: Re: Fundamental forms/models issue

What are you really trying to accomplish here?



I think you're on the right path only one thing I would mention, the page 
constructor is not called only once per application life cycle. Same page can 
be constructed multiple times if you have a link going to that page and you 
calll setResponsePage(new MyPage()).



More on detachable models:

https://cwiki.apache.org/WICKET/detachable-models.html



~ Thank you,

   Paul Bors



On Mon, Feb 18, 2013 at 12:47 PM, Michael Chandler  
michael.chand...@onassignment.com wrote:

 Good morning/afternoon everyone.

 I'm having a basic problem fully deciphering how to best manage my 
 forms, specifically related to Models that are attached to forms.  
 Since a Wicket WebPage has it's constructor invoked only one time in 
 the application lifecycle, I'm failing to fully understand how to 
 present a form that has a model bound to it without inadvertently 
 sharing that instance of the Model with every user of the application.  
 It seems like a fundamental issue that I'm failing to fully grasp and could 
 use some input.

 As an example, I have the following in my constructor:

 LoadableDetachableModelJob jobModel = new 
 LoadableDetachableModelJob() {

  private static final long serialVersionUID = 1L;

  @Override
  protected Job load() {
Job job = (Job) EntityFactory.getInstance().getBean(job);

// if we're editing an existing job, load the object
if (jobId = 1) {
 job.load(jobId);
}

return job;
  }

 };

 I later create a form and after adding it in my constructor, bind the 
 model to it as follows:

 jobForm.setModel(new CompoundPropertyModelJob(jobModel));

 As you can imagine, every user session from this point on now has that 
 instance of a Job object bound to that form due to these declarations 
 being in the page constructor.  I have come a long way on my own, but 
 I'm at a point where I clearly do not have a full grasp of how to best 
 approach this.  I suspect I can potentially override an instance of a 
 Model's
 getObject() method for more dynamic behavior, but I'm concerned about 
 writing code that becomes too verbose when perhaps there's a 
 better/tighter way to handle this.  Can anyone advise me?

 Many thanks!

 Mike Chandler



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



Re: Anyone using Wicket-Stuff Facebook

2013-02-18 Thread Stephen Walsh
I'm also using Scribe, Martin.  I'm following up with the developer to
figure out how to use it.  He has a copy and paste in his example which
obviously won't work for an actual user.

https://github.com/fernandezpablo85/scribe-java/blob/master/src/test/java/org/scribe/examples/FacebookExample.java

___
Stephen Walsh | http://connectwithawalsh.com


On Mon, Feb 18, 2013 at 1:53 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 If you need to implement OAuth authentication then I can recommend you
 https://github.com/fernandezpablo85/scribe-java
 It is easy to implement both OAuth v.1 and v.2 with it


 On Mon, Feb 18, 2013 at 5:28 AM, Stephen Walsh 
 step...@connectwithawalsh.com wrote:

  https://github.com/wicketstuff/core/wiki/Facebook
 
  Anyone using this that can point me in the right direction on how to use
  the behaviors?
 
  I followed the example on getting a login button and it seems like that
  works well, but I have no idea to tell if the user has validated and how
 to
  capture that validation.  Clearly it's in the behaviors section of the
 jar,
  but I'm not quite sure how to use it.
 
  Thanks.
  ___
  Stephen Walsh | http://connectwithawalsh.com
 



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



RE: Fundamental forms/models issue

2013-02-18 Thread Michael Chandler
To conclude, my issues stemmed from not properly linking from page to page.  I 
did a lot of this:

BookmarkablePageLinkString(link, MyClass.class);

Instead of this:

LinkString(link) {
public void onClick() {
setResponsePage(new MyClass());
}
}

Oopsy!

I can see how the former might benefit me down the road, but not for general 
use.

Thanks again everyone.

Mike

-Original Message-
From: Michael Chandler [mailto:michael.chand...@onassignment.com] 
Sent: Monday, February 18, 2013 10:35 AM
To: users@wicket.apache.org
Subject: RE: Fundamental forms/models issue

Oh my gosh, Paul.  You just nailed my problem I think.

I'm doing this:

setResponsePage(MyPage.class);

Instead of this:

setResponsePage(new MyPage());

Thanks for the link.  Clearly, I have more reading to do!

Thanks all!

Mike

-Original Message-
From: Paul Bors [mailto:p...@bors.ws]
Sent: Monday, February 18, 2013 10:08 AM
To: users@wicket.apache.org
Subject: Re: Fundamental forms/models issue

What are you really trying to accomplish here?



I think you're on the right path only one thing I would mention, the page 
constructor is not called only once per application life cycle. Same page can 
be constructed multiple times if you have a link going to that page and you 
calll setResponsePage(new MyPage()).



More on detachable models:

https://cwiki.apache.org/WICKET/detachable-models.html



~ Thank you,

   Paul Bors



On Mon, Feb 18, 2013 at 12:47 PM, Michael Chandler  
michael.chand...@onassignment.com wrote:

 Good morning/afternoon everyone.

 I'm having a basic problem fully deciphering how to best manage my 
 forms, specifically related to Models that are attached to forms.
 Since a Wicket WebPage has it's constructor invoked only one time in 
 the application lifecycle, I'm failing to fully understand how to 
 present a form that has a model bound to it without inadvertently 
 sharing that instance of the Model with every user of the application.
 It seems like a fundamental issue that I'm failing to fully grasp and could 
 use some input.

 As an example, I have the following in my constructor:

 LoadableDetachableModelJob jobModel = new
 LoadableDetachableModelJob() {

  private static final long serialVersionUID = 1L;

  @Override
  protected Job load() {
Job job = (Job) EntityFactory.getInstance().getBean(job);

// if we're editing an existing job, load the object
if (jobId = 1) {
 job.load(jobId);
}

return job;
  }

 };

 I later create a form and after adding it in my constructor, bind the 
 model to it as follows:

 jobForm.setModel(new CompoundPropertyModelJob(jobModel));

 As you can imagine, every user session from this point on now has that 
 instance of a Job object bound to that form due to these declarations 
 being in the page constructor.  I have come a long way on my own, but 
 I'm at a point where I clearly do not have a full grasp of how to best 
 approach this.  I suspect I can potentially override an instance of a 
 Model's
 getObject() method for more dynamic behavior, but I'm concerned about 
 writing code that becomes too verbose when perhaps there's a 
 better/tighter way to handle this.  Can anyone advise me?

 Many thanks!

 Mike Chandler



-
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: Fundamental forms/models issue

2013-02-18 Thread Paul Bors
Glad I could help, below is the API for Wicket 5's setResponsePage:
http://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html
C extends 
IRequestablePagehttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/component/IRequestablePage.html

void*setResponsePagehttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#setResponsePage(java.lang.Class)
*(java.lang.ClassC cls)
Sets the page that will respond to this requestC extends
IRequestablePagehttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/component/IRequestablePage.html

void*setResponsePagehttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#setResponsePage(java.lang.Class,
org.apache.wicket.request.mapper.parameter.PageParameters)*(java.lang.ClassC
cls, 
PageParametershttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/mapper/parameter/PageParameters.htmlparameters)
Sets the page class and its parameters that will respond to this requestvoid
*setResponsePagehttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#setResponsePage(org.apache.wicket.Page)
*(Page http://wicket.apache.org/apidocs/1.5/org/apache/wicket/Page.htmlpage)
Sets the page that will respond to this request


What that dosen't mention is what page instance is used or when/how a new
Page is constructed.

Give the Page maps a read to grasp that concept:
https://cwiki.apache.org/WICKET/page-maps.html
~ Thank you,
Paul Bors

PS: You could try purchasing an older version of Wicket in Action or some
other book too, that's how I picked up Wicket :)
http://wicket.apache.org/learn/books/

On Mon, Feb 18, 2013 at 1:34 PM, Michael Chandler 
michael.chand...@onassignment.com wrote:

 Oh my gosh, Paul.  You just nailed my problem I think.

 I'm doing this:

 setResponsePage(MyPage.class);

 Instead of this:

 setResponsePage(new MyPage());

 Thanks for the link.  Clearly, I have more reading to do!

 Thanks all!

 Mike

 -Original Message-
 From: Paul Bors [mailto:p...@bors.ws]
 Sent: Monday, February 18, 2013 10:08 AM
 To: users@wicket.apache.org
 Subject: Re: Fundamental forms/models issue

 What are you really trying to accomplish here?



 I think you're on the right path only one thing I would mention, the page
 constructor is not called only once per application life cycle. Same page
 can be constructed multiple times if you have a link going to that page and
 you calll setResponsePage(new MyPage()).



 More on detachable models:

 https://cwiki.apache.org/WICKET/detachable-models.html



 ~ Thank you,

Paul Bors



 On Mon, Feb 18, 2013 at 12:47 PM, Michael Chandler 
 michael.chand...@onassignment.com wrote:

  Good morning/afternoon everyone.
 
  I'm having a basic problem fully deciphering how to best manage my
  forms, specifically related to Models that are attached to forms.
  Since a Wicket WebPage has it's constructor invoked only one time in
  the application lifecycle, I'm failing to fully understand how to
  present a form that has a model bound to it without inadvertently
  sharing that instance of the Model with every user of the application.
  It seems like a fundamental issue that I'm failing to fully grasp and
 could use some input.
 
  As an example, I have the following in my constructor:
 
  LoadableDetachableModelJob jobModel = new
  LoadableDetachableModelJob() {
 
   private static final long serialVersionUID = 1L;
 
   @Override
   protected Job load() {
 Job job = (Job) EntityFactory.getInstance().getBean(job);
 
 // if we're editing an existing job, load the object
 if (jobId = 1) {
  job.load(jobId);
 }
 
 return job;
   }
 
  };
 
  I later create a form and after adding it in my constructor, bind the
  model to it as follows:
 
  jobForm.setModel(new CompoundPropertyModelJob(jobModel));
 
  As you can imagine, every user session from this point on now has that
  instance of a Job object bound to that form due to these declarations
  being in the page constructor.  I have come a long way on my own, but
  I'm at a point where I clearly do not have a full grasp of how to best
  approach this.  I suspect I can potentially override an instance of a
  Model's
  getObject() method for more dynamic behavior, but I'm concerned about
  writing code that becomes too verbose when perhaps there's a
  better/tighter way to handle this.  Can anyone advise me?
 
  Many thanks!
 
  Mike Chandler
 
 

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




RE: Anyone using Wicket-Stuff Facebook

2013-02-18 Thread Michael Chandler
I also plan to use Scribe and spent a little time with it this weekend.  My 
particular example uses LinkedIn, but the implementations would probably be 
near identical.  In this particular example, I'm trying to retrieve the 
Authorize URL that a user would use to authenticate with LinkedIn.  The 
following method returns the API hyperlink that I would use for a Login with 
LinkedIn button:

private String getLinkedInAuth() {
OAuthService service = new ServiceBuilder()
.provider(LinkedInApi.class)
.apiKey(your_api_key).apiSecret(your_api_secret_hash).build();

Token requestToken = service.getRequestToken();
String link = service.getAuthorizationUrl(requestToken);

return link;
}

I haven't done much from there, but I believe you should be able to define a 
return URL when a user successfully authenticates that you host (check your 
Facebook app config on Facebook.com).  That URL should be prepared to accept a 
response that will include the user's access token which you will use to sign 
any of your graph api requests.

I haven't completed my integration so hopefully I am not over simplifying.

Mike

-Original Message-
From: Stephen Walsh [mailto:step...@connectwithawalsh.com] 
Sent: Monday, February 18, 2013 10:47 AM
To: users@wicket.apache.org
Subject: Re: Anyone using Wicket-Stuff Facebook

I'm also using Scribe, Martin.  I'm following up with the developer to figure 
out how to use it.  He has a copy and paste in his example which obviously 
won't work for an actual user.

https://github.com/fernandezpablo85/scribe-java/blob/master/src/test/java/org/scribe/examples/FacebookExample.java

___
Stephen Walsh | http://connectwithawalsh.com


On Mon, Feb 18, 2013 at 1:53 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 If you need to implement OAuth authentication then I can recommend you 
 https://github.com/fernandezpablo85/scribe-java
 It is easy to implement both OAuth v.1 and v.2 with it


 On Mon, Feb 18, 2013 at 5:28 AM, Stephen Walsh  
 step...@connectwithawalsh.com wrote:

  https://github.com/wicketstuff/core/wiki/Facebook
 
  Anyone using this that can point me in the right direction on how to 
  use the behaviors?
 
  I followed the example on getting a login button and it seems like 
  that works well, but I have no idea to tell if the user has 
  validated and how
 to
  capture that validation.  Clearly it's in the behaviors section of 
  the
 jar,
  but I'm not quite sure how to use it.
 
  Thanks.
  ___
  Stephen Walsh | http://connectwithawalsh.com
 



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


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



Re: Migration issue: page that writes binary data to the response

2013-02-18 Thread Carl-Eric Menzel
On Mon, 18 Feb 2013 19:03:41 +0100
Martin Dietze d...@fh-wedel.de wrote:

 On Mon, February 18, 2013, Carl-Eric Menzel wrote:
 
  Is there a particular reason you're using a page?
 
 One - unfortunately - big reason: it's legacy code (most of
 which I did not even write myself). The Wicket upgrade is badly
 needed for browser compatibiy, however I don't want to change
 code if it's not absolutely necessary. 

For generating binaries, I would *really* recommend doing this change.
Pages simply are not a good fit for that. Also, it shouldn't be that
big of a change, since you're writing to the Response anyway. Within
AbstractResource's WriteCallback you're going to use the same Response
object, so you can simply copy most of your code over without much
change.

(pseudocode from memory, but close enough)

MyResource extends AbstractResource {
 @Override newResourceResponse(Attributes att) {
  att.setFilename(foo.pdf);
  att.disableCaching();
  att.setContentType(text/pdf);
  att.setWriteCallback(new WriteCallback() {
@Override writeData(Attributes att) {
  Response r = att.getResponse();
  // write to the response here like you did before
}
  });
 }
}

Except in this case you won't have to mangle the Response object like
you have to do with the page.

Carl-Eric


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



Re: Anyone using Wicket-Stuff Facebook

2013-02-18 Thread Stephen Walsh
On Mon, Feb 18, 2013 at 1:59 PM, Michael Chandler 
michael.chand...@onassignment.com wrote:

 you should be able to define a return URL when a user successfully
 authenticates that you host


This is the part that I don't understand.  I guess I create a separate
OAuth class page that launches when the user authenticates, but how I get
the code out of the URL?  I need the code to send back to Facebook so I can
get an access token.

The other part that is confusing to me is that I had an identical JUnit
test set up to do what you did above, but I'm getting an error:

 java.lang.UnsupportedOperationException: Unsupported operation, please
use 'getAuthorizationUrl' and redirect your users there

on this line Token requestToken = service.getRequestToken();

I'd be really interested to see how you implement with LinkedIn as I assume
it will be very similar for my implementation.

Thanks, Mike.

___
Stephen Walsh | http://connectwithawalsh.com


Re: how to modify internal JavascriptResourceReference packaged with component

2013-02-18 Thread Francois Meillet
final ResourceReference YOURJS = new JavaScriptResourceReference(   
Yourclass.class, YourMultiFileUploadField.js);
final int max = 3;
MultiFileUploadField x = new MultiFileUploadField(yourid){

@Override
public void renderHead(IHeaderResponse response) {
response.render(JavaScriptHeaderItem.forReference(YOURJS));
response.render(OnDomReadyHeaderItem.forScript(new 
MultiSelector(' + getInputName() +   ', document.getElementById('container'), 
 + max + ,' +getString(org.apache.wicket.mfu.delete) + 
').addElement(document.getElementById('upload'));));
}
};

I think it's a good compromise

François Meillet
Formation Wicket - Développement Wicket





Le 18 févr. 2013 à 19:26, evan e...@novelution.com a écrit :

 
 This is improved in Wicket 6.
 You can use
 org.apache.wicket.protocol.http.WebApplication#addResourceReplacement for
 exactly this use case.
 See http://wicketinaction.com/2012/07/wicket-6-resource-management/
 You are recommended to upgrade your application.
 
 
 Nice - the addResourceReplacement is great.  Thanks Martin - I will
 try to upgrade the application soon.  In the meantime, I will override
 the necessary methods in the class, as per Francois' suggestion.
 
 
 
 if the question is how to modify internal JavascriptResourceReference
 packaged with component
 I will just override
@Override
public void renderHead(IHeaderResponse response)
{
// initialize the javascript library
response.render(JavaScriptHeaderItem.forReference(JS));
response.render(OnDomReadyHeaderItem.forScript(new 
 MultiSelector(' + getInputName() +
', document.getElementById(' + 
 container.getMarkupId() + '),  + max + ,' +
getString(org.apache.wicket.mfu.delete) + 
 ').addElement(document.getElementById(' +
upload.getMarkupId() + '));));
}
 Max is the max number of files a user can upload.
 container.getMarkupId() is container
 upload.getMarkupId() is upload
 
 
 
 Francois, I'm sorry to belabor this question - but I just want to make
 sure I'm not missing something still.  I think I understand what to do
 now and it works - I was just pointing out that if I extend the
 MultiFileUploadField class, it is not enough to only override that one
 method, because the reference to those 3 variables in my overridden
 method would be trying to reference private members from the super
 class and won't be allowed.  So, I just need to also create a new
 version of the variables in the extended class, and override the
 constructors in which they are defined, and any other methods in which
 they are referenced.  Were you saying in your last response that this
 is not necessary, for some reason that I'm still missing?  In any
 case, doing it this way works and is fine as a temporary solution
 until I upgrade and can use the addResourceReplacement approach.
 Thanks again for all the help!
 
 Best,
 -Evan
 
 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/how-to-modify-internal-JavascriptResourceReference-packaged-with-component-tp4656344p4656516.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 



RE: Anyone using Wicket-Stuff Facebook

2013-02-18 Thread Michael Chandler
Hi Stephen

 you should be able to define a return URL when a user successfully 
 authenticates that you host

 This is the part that I don't understand.  I guess I create a separate OAuth
 class page that launches when the user authenticates, but how I get the code 
 out of the URL?  I need the code to send back to Facebook so I can get an
 access token.

Right.  In the Scribe example, you are working in the console so a code is 
provided that you punch in to your console which gets consumed by a Verifier.  
I don't believe it will work that way in an actual seemless integration.  
Instead, you should be able to define a OAuth Accept Redirect URL which 
effectively informs Facebook to post back the credentials to that URL you 
specify.  Here is where I am assuming since I haven't completed the 
integration... instead of getting an access token by sending the Verifer 
instance back to Facebook with the request token, Facebook should post the 
access token to your OAuth Accept Redirect URL which you can consume and set to 
a Token instance.  Again, I'm assuming at this point.  It's possible that your 
OAuth Accept Redirect URL consumes that code and then you're expected to 
request the access token at that point...

Go to your Facebook App in the Developers console and define a URL for the 
OAuth Redirect URI.  Put something together and try it.  I believe it will send 
back an access token in the query string if memory serves.

When I have something working, I'll gladly share it with you to provide 
clarification.

Mike

-Original Message-
From: Stephen Walsh [mailto:step...@connectwithawalsh.com] 
Sent: Monday, February 18, 2013 12:26 PM
To: users@wicket.apache.org
Subject: Re: Anyone using Wicket-Stuff Facebook

On Mon, Feb 18, 2013 at 1:59 PM, Michael Chandler  
michael.chand...@onassignment.com wrote:

 you should be able to define a return URL when a user successfully 
 authenticates that you host


This is the part that I don't understand.  I guess I create a separate OAuth 
class page that launches when the user authenticates, but how I get the code 
out of the URL?  I need the code to send back to Facebook so I can get an 
access token.

The other part that is confusing to me is that I had an identical JUnit test 
set up to do what you did above, but I'm getting an error:

 java.lang.UnsupportedOperationException: Unsupported operation, please use 
'getAuthorizationUrl' and redirect your users there

on this line Token requestToken = service.getRequestToken();

I'd be really interested to see how you implement with LinkedIn as I assume it 
will be very similar for my implementation.

Thanks, Mike.

___
Stephen Walsh | http://connectwithawalsh.com

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



Re: Anyone using Wicket-Stuff Facebook

2013-02-18 Thread Stephen Walsh
On Mon, Feb 18, 2013 at 5:27 PM, Michael Chandler 
michael.chand...@onassignment.com wrote:

 Facebook should post the access token to your OAuth Accept Redirect URL
 which you can consume and set to a Token instance.


The browser gets a token back that makes perfect sense and the example is
completed.  How do I consume the token?  I'll play around with it a bit
and let you know what I come up with.  Thanks for the help.

___
Stephen Walsh | http://connectwithawalsh.com


RE: Anyone using Wicket-Stuff Facebook

2013-02-18 Thread Michael Chandler
 The browser gets a token back that makes perfect sense and the example is 
 completed.
 How do I consume the token?  I'll play around with it a bit and let you 
 know what
 I come up with.  Thanks for the help.

Based on the path I was taking, the redirect URI is the key.  Facebook 
redirects as such:

YOUR_REDIRECT_URI?
access_token=USER_ACCESS_TOKEN
   expires_in=NUMBER_OF_SECONDS_UNTIL_TOKEN_EXPIRES
   state=YOUR_STATE_VALUE

Of course, if the request fails authentication, they redirect as follows:

YOUR_REDIRECT_URI?
error_reason=user_denied
   error=access_denied
   error_description=The+user+denied+your+request.
   state=YOUR_STATE_VALUE

So your redirect page could start out like this:

public class FacebookResponseListener extends WebPage {

private static final long serialVersionUID = 1L;

public FacebookResponseListener(PageParameters params) {
// if there is an error, handle it
if (params.get(error_reason) != null) {
// handle the error here!
} else {
String accessToken = 
params.get(access_token).toString();
int expiresIn = params.get(expires_in).toInt();

// etc... etc...

}

}
}

Mike

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



Re: Anyone using Wicket-Stuff Facebook

2013-02-18 Thread Stephen Walsh
That's where I'm headed right now.  I had a signin page with PageParameters
that picked it up by accident...  I think I'm headed in the right direction
now.

I'll post my solution when I get it finished.  I'd still be interested to
see your solution also.

Thanks again.

___
Stephen Walsh | http://connectwithawalsh.com


On Mon, Feb 18, 2013 at 6:29 PM, Michael Chandler 
michael.chand...@onassignment.com wrote:

  The browser gets a token back that makes perfect sense and the example
 is completed.
  How do I consume the token?  I'll play around with it a bit and let
 you know what
  I come up with.  Thanks for the help.

 Based on the path I was taking, the redirect URI is the key.  Facebook
 redirects as such:

 YOUR_REDIRECT_URI?
 access_token=USER_ACCESS_TOKEN
expires_in=NUMBER_OF_SECONDS_UNTIL_TOKEN_EXPIRES
state=YOUR_STATE_VALUE

 Of course, if the request fails authentication, they redirect as follows:

 YOUR_REDIRECT_URI?
 error_reason=user_denied
error=access_denied
error_description=The+user+denied+your+request.
state=YOUR_STATE_VALUE

 So your redirect page could start out like this:

 public class FacebookResponseListener extends WebPage {

 private static final long serialVersionUID = 1L;

 public FacebookResponseListener(PageParameters params) {
 // if there is an error, handle it
 if (params.get(error_reason) != null) {
 // handle the error here!
 } else {
 String accessToken =
 params.get(access_token).toString();
 int expiresIn = params.get(expires_in).toInt();

 // etc... etc...

 }

 }
 }

 Mike

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




Re: Why does my HelloWorldPage not work?

2013-02-18 Thread mike.hua
Thanks for Martin and Ernesto's help!
I have done that,but other Errors happened!

Tomcat Server:
A child container failed during start
java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyFirstWicket]]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyFirstWicket]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7 more
Caused by: java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
at java.lang.Class.getDeclaredFields(Class.java:1760)
at
org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at
org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationFilterAnnotations(WebAnnotationSet.java:110)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:66)
at
org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 21 more

http://apache-wicket.1842946.n4.nabble.com/file/n4656532/WicketError.png 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656532.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Label with default text if model empty + CompoundPropertyModel

2013-02-18 Thread Ondrej Zizka

Hi all,

I have:

public FooPage( ... ) {
   this.setDefaultModel( new CompoundPropertyModel(new 
GenericIdLDM( Foo.class, 1)) );

   add(new Label(title));

I'd like to have $subj.
I've found this solution from 2007 (point below) : 
http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg29603.html

However, it wouldn't work for CPM as it needs the constructor with model.

How could I make it CPM?

Thanks,
Ondra




public class DefaultTextModel extends AbstractReadOnlyModelString {

private final IModelString delegate;
private final String def;

public DefaultTextModel(String def, IModel delegate) {
this.def = def;
this.delegate = delegate;
}

public String getObject() {
String s = delegate.getObject();
return (Strings.isEmpty(s)) ? def : s;
}

public void detach() {
delegate.detach();
}

}


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



Re: Why does my HelloWorldPage not work?

2013-02-18 Thread Ondrej Zizka

Hi Mike,

These problems are not wicket specific.
I'd suggest to make your life easier and switch to Maven.
Then, Maven and IDE would handle most of the dependencies for you - e.g. 
NetBeans searches all Maven repo for classes of given name, and adds it 
to dependencies.


Otherwise, the process goes like:

1) If you see Caused by: java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;
2) Google for org.slf4j.Logger
3) Download latest version of the containing library and put it to your libs
4) Go to 1)

Ondra



On 02/19/2013 05:40 AM, mike.hua wrote:

Thanks for Martin and Ernesto's help!
I have done that,but other Errors happened!

Tomcat Server:
A child container failed during start
java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyFirstWicket]]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyFirstWicket]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7 more
Caused by: java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
at java.lang.Class.getDeclaredFields(Class.java:1760)
at
org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at
org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationFilterAnnotations(WebAnnotationSet.java:110)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:66)
at
org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 21 more

http://apache-wicket.1842946.n4.nabble.com/file/n4656532/WicketError.png



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-my-HelloWorldPage-not-work-tp4656451p4656532.html
Sent from the Users forum mailing list archive at Nabble.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: Label with default text if model empty + CompoundPropertyModel

2013-02-18 Thread Sven Meier

You can override Label#initModel():

protected IModel? initModel()
{
return new DefaultTextModel(defaultModel, super.initModel());
}

A simpler solution is to override Label#onComponentTagBody() and just 
apply your default text there.


Sven


On 02/19/2013 06:29 AM, Ondrej Zizka wrote:

Hi all,

I have:

public FooPage( ... ) {
   this.setDefaultModel( new CompoundPropertyModel(new 
GenericIdLDM( Foo.class, 1)) );

   add(new Label(title));

I'd like to have $subj.
I've found this solution from 2007 (point below) : 
http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg29603.html

However, it wouldn't work for CPM as it needs the constructor with model.

How could I make it CPM?

Thanks,
Ondra




public class DefaultTextModel extends AbstractReadOnlyModelString {

private final IModelString delegate;
private final String def;

public DefaultTextModel(String def, IModel delegate) {
this.def = def;
this.delegate = delegate;
}

public String getObject() {
String s = delegate.getObject();
return (Strings.isEmpty(s)) ? def : s;
}

public void detach() {
delegate.detach();
}

}


-
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: Fundamental forms/models issue

2013-02-18 Thread Hans Lesmeister 2
Hi Michael,


Michael Chandler wrote
 To conclude, my issues stemmed from not properly linking from page to
 page.  I did a lot of this:
 
 BookmarkablePageLink
 String
 (link, MyClass.class);
 
 Instead of this:
 
 Link
 String
 (link) {
   public void onClick() {
   setResponsePage(new MyClass());
   }
 }
 
 Oopsy!

Oopsy is not necessary :-)  Depending on the Use Case, both ways are fully
okay.
If you pass MyClass.class then, as stated before, Wicket creates a fresh
page for you. If you pass an instance, then wicket uses that instance. The
2nd approach can for instance be used if you have state (i.e. a model or
something else) to pass to the new page, but not necessarily.




-
-- 
Regards, 
Hans 

http://cantaa.de 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Fundamental-forms-models-issue-tp4656511p4656537.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: [ANN] wicketstuff-lazymodel

2013-02-18 Thread Martin Grigorov
Hi Sven,

I think it would be useful if you add an explanation to the wiki page how
it works.
As far as I see from the code it is based on reflection by using Objenesis.

I also saw performance tests which verify that LazyModel is at least twice
faster than PropertyModel. This information may be used as an advertisement
in the Wiki page!

Also I think there is an error in this example:


 private static final IModelB B = model(from(A.class).getB());

  IModelA a = ...;

  add(new TextFieldB(b, B.bind(a));


I don't see how 'B' can have method #bind(IModel) unless the IModel in the
example is some other class, not the one in wicket-core.


On Mon, Feb 18, 2013 at 7:30 PM, Sven Meier s...@meiers.net wrote:

 Hi all,

 I've added a new module to wicketstuff:

 LazyModel offers lazy evaluation of method invocations. It takes the best
 from present solutions (safemodel and modelfactory) and improves on
 reflection to support:

 * arbitrary parameters
 * generics
 * collections
 * interfaces

 Two simple examples:

 IModelString model = model(from(a).getB().**
 getStrings().get(key));

 new LazyColumnA, B(header, from(A.class).getB());

 Read more here:

 
 https://github.com/**wicketstuff/core/wiki/**LazyModelhttps://github.com/wicketstuff/core/wiki/LazyModel

 Have fun
 Sven

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




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