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 us

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 > > ("link", MyClass.class); > > Instead of this: > > Link > > ("link") { > public void onClick() { > setRespo

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 Ziz

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 g

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.sour

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].Standa

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. ___

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 redirec

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 c

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

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) { res

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 w

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 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

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

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 http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/component/IRequestablePage.html>> void*setResponsePage

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: BookmarkablePageLink("link", MyClass.class); Instead of this: Link("link") { public void onClick() { setResponsePage(new MyClass()); } } Oopsy! I can see how the f

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

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]

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 addResourceRep

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

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/afterno

Re: Fundamental forms/models issue

2013-02-18 Thread Carl-Eric Menzel
On Mon, 18 Feb 2013 17:47:16 + 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

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

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

[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 exampl

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

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

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 wrote: > Found good solution: > > @Override > protected void init() > { > getRootRequestMapperAsCompound().add(new

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 gener

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 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 v

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 Rott

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" wrote: > >> Hi eve

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(

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 wrote: > Paste the source code: > > *HelloWorldPage.html:* > > *HelloWorldPage.java:* > package myWicket; > > import org.apache.wicket

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;

Re: Why does my "HelloWorldPage" not work?

2013-02-18 Thread mike.hua
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

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 wrote: > > > "java

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 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-wic

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 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

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-HelloWorldPa

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 a

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 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

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(ResourceM

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

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'

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

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. ---

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.

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.h

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 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 startin

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.apach

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. Th

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 wrote: > > Hello, Martin! > > I think such article would be helpful to many others, so if it's not > too much trouble, please, write about it. >

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.|

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 : >Hi Leonid, > >I have no experience with Apache Shiro. >I can blog about how to use Scribe dire

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" wrote: > Hi everyone, > > RichFaces team has started an effort to make their components available > for multiple frameworks. > Currently, the targetted are JSF, GWT/E

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 wrote: > Martin, thanks

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.18

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 wrote: > > Hello, Martin! > > Thank you for your response! Actually I already use Scribe lib, but > indirectly -

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 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 cha

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 : >Hi, > >Wicket doesn't provide an API for internal forwards. Use the Servlet API >for this. > >Al

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, Eva

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 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 i

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

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 wrote: > > Hello! > > I'm trying to add OAuth authenticat

Re: Using tomcat server in wicket application

2013-02-18 Thread Martin Grigorov
On Sun, Feb 17, 2013 at 10:16 PM, kshitiz 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 w