Re: tomcat 6
Argh just saw that I did a typo.. I of course meant start.java :) Everything's setup for you if you use wicket archetype, iolite or wickettopia.. Nino Saturnino Martinez Vazquez Wael wrote: Check you dependencies.. I just use jetty when running from eclipse, much simpler.. Just run start jar or debug start jar.. etc.. Leucht, Axel wrote: Hi, I'm currently trying to get a HelloWorld application running with wicket 1.3.4. I'm doing all my web development from within the Eclipse IDE (3.4 Ganymede), so I suspect setup of the project should be easy. When the server environment is set to tomcat 5.5.27 the HelloWorldApplication runs fine but NOT under tomcat 6.0.16! There is no clue in the logs stating that wicket is started in development mode which it is when started under tc 5.5.27. The application does run when I start tomcat 6.0.16 in standalone mode (outside Eclipse). Does someone knows what to do to make it run from within Eclipse? /Axel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: go back problem
Hi I dont know whether this question is too easy or hard??? Since I'm a newbie of wicket, I dont know whether there are built-in functions for the Back link like the browsers do. Could anyone give me, at least, some ideas?? I'm still trapped by this possibly fish quesion.Thanks a lot for any help. overseastars wrote: Hi all I'm learning to use the library example on the wicket website. But I found that once I got some results by search and I clicked one link to go into that detail page, then I actually could go back to the previous page. The example on the wicket website just provides a link to home, not a real Back link. For example, I'm searching some hotels. I input a keyword in the search bar and then get a list of accommodations. Then I click on one record and I get a list of rooms of that accommodation. Now if I click on one room it will go to the detail page of that room. What if I want to go back to the previous page containing a list of rooms? Furthermore, what if I want to go back to that page including a list of accommodation?? I just put a small piece of my code here. this is the method from the wicket example page. How can I make a back link? I really need this. otherwise my mentor will kill my marks..:-( Please help me. Many thanks~~ public static BookmarkablePageLink link(final String name, final Accommodation accommodation) { clickedAccommodation = accommodation; final BookmarkablePageLink link = new BookmarkablePageLink(name, RoomResultListPage.class); if (accommodation != null) { link.setParameter(aid, accommodation.getAid()); link.add(new Label(name, new Model(accommodation.getName(; } else { link.add(new Label(name, No matched rooms - xingxing)); link.setEnabled(false); } return link; } -- View this message in context: http://www.nabble.com/%22go-back%22-problem-tp20057504p20104879.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: go back problem
you can pass the master page instance into the detail page, then in detail page simply go back class masterpage extends webpage { add(new link(detail) { onclick() { setresponsepage(new detailpage(masterpage.this));}}); } clas detailpage extends webpage { public detailpage(final page back) { add(new link(back) { oncick() { setresponsepage(back);}}); } -igor On Sun, Oct 19, 2008 at 9:04 AM, overseastars [EMAIL PROTECTED] wrote: Hi all I'm learning to use the library example on the wicket website. But I found that once I got some results by search and I clicked one link to go into that detail page, then I actually could go back to the previous page. The example on the wicket website just provides a link to home, not a real Back link. For example, I'm searching some hotels. I input a keyword in the search bar and then get a list of accommodations. Then I click on one record and I get a list of rooms of that accommodation. Now if I click on one room it will go to the detail page of that room. What if I want to go back to the previous page containing a list of rooms? Furthermore, what if I want to go back to that page including a list of accommodation?? I just put a small piece of my code here. this is the method from the wicket example page. How can I make a back link? I really need this. otherwise my mentor will kill my marks..:-( Please help me. Many thanks~~ public static BookmarkablePageLink link(final String name, final Accommodation accommodation) { clickedAccommodation = accommodation; final BookmarkablePageLink link = new BookmarkablePageLink(name, RoomResultListPage.class); if (accommodation != null) { link.setParameter(aid, accommodation.getAid()); link.add(new Label(name, new Model(accommodation.getName(; } else { link.add(new Label(name, No matched rooms - xingxing)); link.setEnabled(false); } return link; } -- View this message in context: http://www.nabble.com/%22go-back%22-problem-tp20057504p20057504.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FireFox 3.x.x issue with wicket
well, make the searchbox wider? ;-) no honestly, i don't believe this is a wicket related issue, sounds like plain html after all ... or do you mean that only half of the text gets submitted? swapnil.wadagave wrote: Respected sir, When I am writing in the search boxes I only see half of the text. This happens with FireFox 3.x.x What can i do in this case?This is happening in some pcs. - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/FireFox-3.x.x-issue-with-wicket-tp20104033p20105053.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FireFox 3.x.x issue with wicket
Thanks For Reply, But Actually half text is not gets submitted.Only pbm is with view.same is working fine with IE and mozila backward version like mozila 2.x.x..So where can i get help for this kind of issues. Regards, swapnil swapnil.wadagave wrote: Respected sir, When I am writing in the search boxes I only see half of the text. This happens with FireFox 3.x.x What can i do in this case?This is happening in some pcs. -- View this message in context: http://www.nabble.com/FireFox-3.x.x-issue-with-wicket-tp20104033p20105253.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to avoid blank node labels in TreeTable?
Hi all, if text is too long to fit into column width of PropertyTreeColumn, then it gets blanked. This results in empty node labels in tree, what is a problem, the more levels the tree has. So I would prefer clipping instead blanks... Any hints for a highly enthusiastic wicket rookie? Best regards Hannes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FireFox 3.x.x issue with wicket
what do you mean by saying But Actually half text is not gets submitted.? If there's a problem on the wicket site it would be helpful to see some code swapnil.wadagave wrote: Thanks For Reply, But Actually half text is not gets submitted.Only pbm is with view.same is working fine with IE and mozila backward version like mozila 2.x.x..So where can i get help for this kind of issues. Regards, swapnil swapnil.wadagave wrote: Respected sir, When I am writing in the search boxes I only see half of the text. This happens with FireFox 3.x.x What can i do in this case?This is happening in some pcs. - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/FireFox-3.x.x-issue-with-wicket-tp20104033p20105728.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Static injection not working (wicket-guice)
Hello, I've been trying to inject a service to some classes that are not wicket components, I've asked here and was suggested to use static injection: InjectorHolder.getInjector().inject(this); however this is not working with guice, I always get an illegalstateexception, injectorholder has not been assigned an injector. I've tried ((GuiceInjectorHolder) (RequestCycle.get().getApplication().getMetaData(GuiceInjectorHolder.INJECTOR_KEY))).getInjector().injectMembers(this); however that gives me serialization problems, since wicket is not creating a proxy for my service. I'm on my way to give salve a try but I'm having some problems there too (waiting for a response from the Discussion group), what suggestions can you make? Thanks in advance, Edgar Merino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Why is Wicket called Wicket?
We where just chating here, and we're wondering where the name wicket comes from ? Looking it up on in the dictionary I couldn't really see the connection. Anyone know how the name came about? thanks Wayne
RE: Validation Messages
Thank you, but it seems that only found resources are logged. Meanwhile I have found out that I have to use a key like this: myform.tabs.panel.myfield=My Field where tabs is the id of my tabbed panel. But I haven't found a log message that points to a missing key myform.tabs.panel.myfield. Kai Igor Vaynberg mailto:[EMAIL PROTECTED] wrote: log4j.logger.org.apache.wicket.resource=DEBUG should do it afair. -igor On Tue, Oct 21, 2008 at 8:16 AM, Kai Mütz [EMAIL PROTECTED] wrote: Hi, I have some problems with validation messages. Normally I set my validation messages within the property files like this: Required='${label}' is required StringValidator.maximum='${label}' [...] ${maximum} [...] myform.myfield=My Field and got (as expected) 'My Field' is required if I do not fill myfield. A problem occurs with a form which contains a tapped panel. The validator does not find the resource and I got the message 'myfield' is required. Is there a possibility to find out which resource key the validator uses to find the resource? And in which property files the validator is searching? Thanks in advance, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why is Wicket called Wicket?
Jonathan Locke wrote something about it in his foreword in WIA: Several 60-hour weeks later, the first version of Wicket was born. (In case you’re wondering, Wicket was the first fun and unique-sounding short word that Miko also liked and that wasn’t being used for a major software project. It also appears in some dictionaries as a cricket term for “a small framework at which the bowler aims the ball.”) I’m happy to say that after more than four years and the input of many manyears of effort from the open source community, Wicket now meets most if not all of my criteria for a web framework Wayne Pope wrote: We where just chating here, and we're wondering where the name wicket comes from ? Looking it up on in the dictionary I couldn't really see the connection. Anyone know how the name came about? thanks Wayne -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why is Wicket called Wicket?
thanks Nino, I knew I'd seen it somewhere but couldn't remember. so it was reference to the game of cricket stumps rather than to quote a dictionary: a window or opening, often closed by a grating or the like, as in a door, or forming a place of communication in a ticket office, a teller's cage in a bank, etc. On Wed, Oct 22, 2008 at 10:59 AM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Jonathan Locke wrote something about it in his foreword in WIA: Several 60-hour weeks later, the first version of Wicket was born. (In case you're wondering, Wicket was the first fun and unique-sounding short word that Miko also liked and that wasn't being used for a major software project. It also appears in some dictionaries as a cricket term for a small framework at which the bowler aims the ball.) I'm happy to say that after more than four years and the input of many manyears of effort from the open source community, Wicket now meets most if not all of my criteria for a web framework Wayne Pope wrote: We where just chating here, and we're wondering where the name wicket comes from ? Looking it up on in the dictionary I couldn't really see the connection. Anyone know how the name came about? thanks Wayne -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to unittest a checkbox
Hi folks, Creating unittests for my pages I managed to read the value a checkbox of a rendered page. I used: tester.assertModelValue( form:myCheckBox, true ); However I failed to change that value in my unittest prior to submitting the form. Can anyone point in the right direction? Kind regards, Minto van der Sluis -- View this message in context: http://www.nabble.com/how-to-unittest-a-checkbox-tp20106917p20106917.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: Wicket community traction / Wicket Web 2.0 experience
Martin, Richard, thanks for your answers! Unfortunately, I could not convince the other devs of the various advantages of wicket. The team chose GWT because it allows to create Web 2.0 style user interfaces with fewer effort. Regards, Christoph
Re: Why is Wicket called Wicket?
Seems so. I like to think of the sentence a small framework at which the bowler aims the ball. As doing a bullseye, within web frameworks:) Wayne Pope wrote: thanks Nino, I knew I'd seen it somewhere but couldn't remember. so it was reference to the game of cricket stumps rather than to quote a dictionary: a window or opening, often closed by a grating or the like, as in a door, or forming a place of communication in a ticket office, a teller's cage in a bank, etc. On Wed, Oct 22, 2008 at 10:59 AM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Jonathan Locke wrote something about it in his foreword in WIA: Several 60-hour weeks later, the first version of Wicket was born. (In case you're wondering, Wicket was the first fun and unique-sounding short word that Miko also liked and that wasn't being used for a major software project. It also appears in some dictionaries as a cricket term for a small framework at which the bowler aims the ball.) I'm happy to say that after more than four years and the input of many manyears of effort from the open source community, Wicket now meets most if not all of my criteria for a web framework Wayne Pope wrote: We where just chating here, and we're wondering where the name wicket comes from ? Looking it up on in the dictionary I couldn't really see the connection. Anyone know how the name came about? thanks Wayne -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Automatic inserting HTML code
Hi, I have probably a newbie question, but I cannot find way how to do it. I my application I use many AjaxLinks. I always want the link to be represented by an image. The image is always the same so I want to prevent myself for writing the same code. I made my component that extends AjaxLink. In constructor of this component I just add the image to it. add (new Image (myImg, new ResourceReference (myImg))); Now I need to automatically add the correspond HTML code img wicket:id=myImg border=0 / to the web page when I use this component. E.G. JAVA . add (new MyAjaxLink (myLink) { @Override public void onClick (AjaxRequestTarget target) { ... } ); . and HTML . a wicket:id=my link here should be the HTML code from my component /a . will be rendered as a wicket:id=my link img wicket:id=myImg border=0 / /a I know that the functionality that I ant is provided by Panel Component. But I need it when using component that extends AjaxLink not Panel. I think that one possible reason is to insert the image to my component as a Panel. But that will be very awful reason. Is there any other way how to do it?? Thank for any advice. Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Antwort: Wicket community traction / Wicket Web 2.0 experience
That's ok Chris, It's just a matter of time until they find out they did the wrong choice - unless this is going to be a small software, with very specific functions, like GMail. :-) There's a team by my side here that is working in a sub-project with GWT and they chose it using that same argument: easy creation of Web2.0 style user interfaces. But now, they are going nuts because of how big the code is getting (and the project is by far from the end) - so, it's not just about few effort. You have to consider everything. Maintenance is one of them. By the way, it's really hard to create custom components within GWT. So I think you can see the problem here about code size. But, good luck for the rest of you team... I'll pray for them... :-D Best regards (really), Bruno On Oct 22, 2008 6:41am, [EMAIL PROTECTED] wrote: Martin, Richard, thanks for your answers! Unfortunately, I could not convince the other devs of the various advantages of wicket. The team chose GWT because it allows to create Web 2.0 style user interfaces with fewer effort. Regards, Christoph
Re: Why is Wicket called Wicket?
Because it's wicked, man! (see http://onlineslangdictionary.com/definition+of/wicked http://onlineslangdictionary.com/definition+of/wicked ) -- View this message in context: http://www.nabble.com/Why-is-Wicket-called-Wicket--tp20106097p20108508.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax validating individual form fields
Hi fatefree, On 22 okt 2008, at 03:53, fatefree wrote: Thank you very much, I didn't realize that the AjaxFormComponentUpdatingBehavior submitted individual components, I guess i got it confused with AjaxFormValidatingBehavior. I think the only issue is when a form level validator needs to be used, for instance to compare that two fields are equal. Am I correct in assuming theres no way to attach a form component validator to a field and have it compare against the value of another component? If so I'm not sure if it would be possible to fire a form level validator on the onblur of the second component without submitting the entire form. I think you are correct. Maybe it is an option to write a custom validator that compares the two fields, and attach that to the second field. The error can then be shown at the second field. Another issue I thought of is if you use a password text field you wouldn't be able to use AjaxFormComponentUpdatingBehavior because even if the input is valid it would erase immediately. Maybe there is a clever way to override the isPasswordReset so that it only is true when the form is submit through a button and not that behavior? I have no idea, but am curious to see your solution :-). Regards, Daan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Wicket and Ext JS integration
We currently use Ext JS 2.2 (http://extjs.com) with Struts 1.x, and we are considering migrating to Wicket. I have seen on the mail archive that some people have integrated Wicket and Ext JS with mixed success. In particular, I found the wicket-tools-extjs project, http://www.wickettools.org/index.php/extjs-integrationm, which is version 0.1.0, published in February 2008. Is the wicket-tools-extjs project in active development or was that project abandoned? Is there any other significant work undergoing to integrate Wicket and Ext JS? Thanks, Richard Allen
Re: how to unittest a checkbox
Have you tried using FormTester? On Wed, Oct 22, 2008 at 5:20 AM, Minto van der Sluis [EMAIL PROTECTED] wrote: Hi folks, Creating unittests for my pages I managed to read the value a checkbox of a rendered page. I used: tester.assertModelValue( form:myCheckBox, true ); However I failed to change that value in my unittest prior to submitting the form. Can anyone point in the right direction? Kind regards, Minto van der Sluis -- View this message in context: http://www.nabble.com/how-to-unittest-a-checkbox-tp20106917p20106917.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FireFox 3.x.x issue with wicket
I think they mean that it is not the case that half of the text is submitted. The only problem is in the view. On Wed, Oct 22, 2008 at 3:54 AM, Michael Sparer [EMAIL PROTECTED] wrote: what do you mean by saying But Actually half text is not gets submitted.? If there's a problem on the wicket site it would be helpful to see some code swapnil.wadagave wrote: Thanks For Reply, But Actually half text is not gets submitted.Only pbm is with view.same is working fine with IE and mozila backward version like mozila 2.x.x..So where can i get help for this kind of issues. Regards, swapnil swapnil.wadagave wrote: Respected sir, When I am writing in the search boxes I only see half of the text. This happens with FireFox 3.x.x What can i do in this case?This is happening in some pcs. - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/FireFox-3.x.x-issue-with-wicket-tp20104033p20105728.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CSRF Protection: double submitted cookie
I've created a ticket and attached a reference implementation: https://issues.apache.org/jira/browse/WICKET-1885 Jörn On Mon, Oct 20, 2008 at 11:31 PM, Jörn Zaefferer [EMAIL PROTECTED] wrote: The double-submitted-cookie isn't related to double submit protection, no. Thats a completely different turf. With that out of the way, its enough to create just one cookie and use that both while rendering and validating forms. I hope that makes it clearer. I'll try to provide a reference implementation tomorrow. Jörn On Mon, Oct 20, 2008 at 12:58 PM, Johan Compagner [EMAIL PROTECTED] wrote: hmm i will read the paper then I stil dont get it how it is possible with 1 cookie, that then can never change when it is first generated and all the forms also just have that value right? But it is also for double submit protection right? So the cookie has to change right? But how can you then have 1 cookie? for all the forms? If i submit one and that is rerendered or redirected to another page. (so it has a new cookie so the double submit cant happen) But if a new cookie is set then all other forms are also suddenly invalid.. and that looks pretty wrong to me johan On Mon, Oct 20, 2008 at 12:44 PM, Jörn Zaefferer [EMAIL PROTECTED] wrote: No, the cookie is subject to the same-origin-policy, both in reading and writing. The request is authenticated because the session cookie is set, but its invalid when the form itself is missing the value. Combining the attack with XSS would give access to the cookie, but then he could just as well hijack the session directly. In other words: With CSRF alone there is no way for the attacker to read the cookie, therefore its enough to use just one. Their whitepaper may do a better job of explaining the techniquie: http://www.freedom-to-tinker.com/sites/default/files/csrf.pdf Solutions are described on page 8ff. Jörn On Mon, Oct 20, 2008 at 12:33 PM, Johan Compagner [EMAIL PROTECTED] wrote: what i dont get if an attacker wants to submit the form. and it can get to the form it can do the post but you say it cant access the cookie. But if the cookie value is just compared to the form post value we have to make sure that the name of the cookie cant be guessed right? So what should the name be? Because if the name would be wicket-form-uuid then couldnt the attacker also just generate that cookie? I guess there is a cookie per form (there can be many forms on the same page or different active pages) and that cookie must be regenerated/set on every form render? johan On Mon, Oct 20, 2008 at 11:27 AM, Jörn Zaefferer [EMAIL PROTECTED] wrote: Hi, my application currently uses CryptedUrlWebRequestCodingStrategy to protect against CRSF attacks. Afaik 1.3.5 will include an update that generates the key based on user sessions: http://issues.apache.org/jira/browse/WICKET-1782 According to Johan Compagner, there are still issues with that approach, though I don't know if that has been fixed: http://www.nabble.com/Wicket-not-secure--to19556259.html#a19557593 Anyway, the point of this mail is to bring up a different strategy for CSRF protection, the double-submitted-cookie. Discussion of that are here http://www.codinghorror.com/blog/archives/001175.html which links to this article, including a whitepaper: http://freedom-to-tinker.com/blog/wzeller/popular-websites-vulnerable-cross-site-request-forgery-attacks The basic idea is: When a user visits a site, the site should generate a (cryptographically strong) pseudorandom value and set it as a cookie on the user's machine. The site should require every form submission to include this pseudorandom value as a form value and also as a cookie value. When a POST request is sent to the site, the request should only be considered valid if the form value and the cookie value are the same. When an attacker submits a form on behalf of a user, he can only modify the values of the form. An attacker cannot read any data sent from the server or modify cookie values, per the same-origin policy. This means that while an attacker can send any value he wants with the form, he will be unable to modify or read the value stored in the cookie. Since the cookie value and the form value must be the same, the attacker will be unable to successfully submit a form unless he is able to guess the pseudorandom value. For Wicket, this would mean: Generate a pseudorandom value and set is as a session cookie, when the cookie doesn't yet exist. Insert a hidden input into each form with the generated value. Validate that the value equals the cookie when submitting a form. The input and validation can be abstracted into a Form subclass (or even add it to Wicket's Form class...). That really easy to implement, is much more efficient (generate only one value per user/browser session, store it on the client, not the
Who's in charge of wicketstuff yui?
Korbinian Bachl? Someone else? :) Thanks -- View this message in context: http://www.nabble.com/Who%27s-in-charge-of-wicketstuff-yui--tp20109670p20109670.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pages or components... how do u decide?
Hello Ned, I am using BreadCrumbPanels, and on a BreadCrumbLink, i wanted to pass a parameter but looks like I cannot instantiate the custom constructor of the panel in this case. Please advise. :( //Naveen On Tue, Oct 21, 2008 at 6:19 PM, Ned Collyer [EMAIL PROTECTED] wrote: Their constructor :) Nav Che wrote: Ned, But then how do u pass parameters across the panels??? //nav -- View this message in context: http://www.nabble.com/Pages-or-components...-how-do-u-decide--tp20016807p20100652.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pages or components... how do u decide?
Isn't there already another thread about this question started by you? On Wed, Oct 22, 2008 at 9:27 AM, Nav Che [EMAIL PROTECTED] wrote: Hello Ned, I am using BreadCrumbPanels, and on a BreadCrumbLink, i wanted to pass a parameter but looks like I cannot instantiate the custom constructor of the panel in this case. Please advise. :( //Naveen On Tue, Oct 21, 2008 at 6:19 PM, Ned Collyer [EMAIL PROTECTED] wrote: Their constructor :) Nav Che wrote: Ned, But then how do u pass parameters across the panels??? //nav -- View this message in context: http://www.nabble.com/Pages-or-components...-how-do-u-decide--tp20016807p20100652.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Proposal: the browser as a desktop client
Hi, I'd like to propose we leverage existing Java to Javascript compilers to improve Wicket on a couple of fronts. If you think of the web browser as a desktop client involved in a client-server architecture then it becomes obvious that Wicket is currently asking the server to handle a lot of logic on behalf of the client. It does this because it's easier to develop in Java than in Javascript. In an ideal world, the server should only see HTML forms in two states: - their initial state (sent to the client) - their submitted state (merged into the database) The client would be able to communicate with web services in between to update the client-side state but most applications won't even need this. The vast majority of form manipulation (adding rows, data validation) can be handled completely on the client-end. I foresee the following benefits: - Vastly simplified logic: A lot of resources have been spent building the HTML parser and classes related to server-side form manipulation. All these are built in for free in JS. For example, interacting with HTML elements and IDs is far easier than in Java code. - Improved responsiveness for end-users - Improved server scalability - Nice URLs, both for humans and for web crawlers. This would also open up the door for RESTful implementations. This would be different from GWT. You would benefit from the modularity of Wicket, coding HTML and CSS in their native languages. The only difference is that you'd now be manipulating dynamic forms on the client-end instead of the server-end. Let me know what you think. Gili -- View this message in context: http://www.nabble.com/Proposal%3A-the-browser-as-a-desktop-client-tp20111040p20111040.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proposal: the browser as a desktop client
I just to clarify one point. You would still have three types of components: HTML CSS Java You would still be binding the Java code against HTML IDs (clean separation of concerns). The only thing that would change is where the Java code executes. -- View this message in context: http://www.nabble.com/Proposal%3A-the-browser-as-a-desktop-client-tp20111040p20111247.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to submit form to external page sending parameters by post, please Help
Thanks for your response, I've used the second choice...it was very helpful Bye Pablo -- From: Jeremy Thomerson [EMAIL PROTECTED] Sent: Tuesday, October 21, 2008 10:51 PM To: users@wicket.apache.org Subject: Re: How to submit form to external page sending parameters by post, please Help Perhaps one of the following: 1. Don't use wicket Form - use web markup containers of some sort and attribute modifiers to output a form that actually posts directly to the paypal site. (In other words - generate a real form with action= https://www.sandbox.paypal.com.) 2. OR - if you need to post back into Wicket and then submit the information to Paypal - use an HTTP client like Commons to post programmatically. (See http://www.java2s.com/Code/Java/Apache-Common/HttppostmethodExample.htm for example) If you want your user to actually end up at the posted paypal page, as I suspect you do from your details below, I definitely think number one is what you need. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 21, 2008 at 4:49 PM, Pablo Scagno [EMAIL PROTECTED] wrote: Hi, I'm trying to submit a form to Paypal but I don't know how I can do this. I have a wicket form with all the fields that I need to submit but when I redirect the page to paypal I can't send the form fields. I can't put the parameters in the querystring, I must send them by post. This is my code to redirect in the button onSubmit() event RedirectPage redirectPage = new RedirectPage( https://www.sandbox.paypal.com/cgi-bin/webscr;); setResponsePage(redirectPage); ... Is there any way to send the values? My form must be wicket because It depends on a model... Thanks Pablo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket and Ext JS integration
I'm working on a wicket-ext integration project. Until now I've done just really simple stuff, like simple TextField, DateField, TimeField, ComboBox, AutoComplete field and basic (static) grid elements. Though my implementation is trivial I would say that is really promising and I've not found any evident obstacle to a more complete integration. Paolo On Wed, Oct 22, 2008 at 1:53 PM, Richard Allen [EMAIL PROTECTED]wrote: We currently use Ext JS 2.2 (http://extjs.com) with Struts 1.x, and we are considering migrating to Wicket. I have seen on the mail archive that some people have integrated Wicket and Ext JS with mixed success. In particular, I found the wicket-tools-extjs project, http://www.wickettools.org/index.php/extjs-integrationm, which is version 0.1.0, published in February 2008. Is the wicket-tools-extjs project in active development or was that project abandoned? Is there any other significant work undergoing to integrate Wicket and Ext JS? Thanks, Richard Allen
Re: Wicket and Ext JS integration
The GPL licensing of ExtJS is really a brain damage inflicting mess. Personally I would stay very far away from JS libraries that are GPL licensed (it is not clear how the viral aspect infects your server side code, possibly requiring you to ship your server side code to your users—you *are* distributing the GPL licensed code, which is linked to your product) Martijn -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Double clickable rows in AjaxFallbackDefaultDataTable
Hi Does anyone know how to implement something that could do this. Please point me in the right direction. Regards, Yazeed Isaacs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Messages
try org.apache.wicket.Localizer -igor On Wed, Oct 22, 2008 at 1:55 AM, Kai Mütz [EMAIL PROTECTED] wrote: Thank you, but it seems that only found resources are logged. Meanwhile I have found out that I have to use a key like this: myform.tabs.panel.myfield=My Field where tabs is the id of my tabbed panel. But I haven't found a log message that points to a missing key myform.tabs.panel.myfield. Kai Igor Vaynberg mailto:[EMAIL PROTECTED] wrote: log4j.logger.org.apache.wicket.resource=DEBUG should do it afair. -igor On Tue, Oct 21, 2008 at 8:16 AM, Kai Mütz [EMAIL PROTECTED] wrote: Hi, I have some problems with validation messages. Normally I set my validation messages within the property files like this: Required='${label}' is required StringValidator.maximum='${label}' [...] ${maximum} [...] myform.myfield=My Field and got (as expected) 'My Field' is required if I do not fill myfield. A problem occurs with a form which contains a tapped panel. The validator does not find the resource and I got the message 'myfield' is required. Is there a possibility to find out which resource key the validator uses to find the resource? And in which property files the validator is searching? Thanks in advance, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Double clickable rows in AjaxFallbackDefaultDataTable
add a behavior to the row item that listens to ondblclick or whatever the event is called. i am not sure that TRs support this, so check in the browser first. to add the behavior to the row item override newrowitem on the table. -igor On Wed, Oct 22, 2008 at 7:58 AM, Yazeed Isaacs [EMAIL PROTECTED] wrote: Hi Does anyone know how to implement something that could do this. Please point me in the right direction. Regards, Yazeed Isaacs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Automatic inserting HTML code
search this list for TextLink and see how it outputs text into link's body. -igor On Wed, Oct 22, 2008 at 3:08 AM, Milan Křápek [EMAIL PROTECTED] wrote: Hi, I have probably a newbie question, but I cannot find way how to do it. I my application I use many AjaxLinks. I always want the link to be represented by an image. The image is always the same so I want to prevent myself for writing the same code. I made my component that extends AjaxLink. In constructor of this component I just add the image to it. add (new Image (myImg, new ResourceReference (myImg))); Now I need to automatically add the correspond HTML code img wicket:id=myImg border=0 / to the web page when I use this component. E.G. JAVA . add (new MyAjaxLink (myLink) { @Override public void onClick (AjaxRequestTarget target) { ... } ); . and HTML . a wicket:id=my link here should be the HTML code from my component /a . will be rendered as a wicket:id=my link img wicket:id=myImg border=0 / /a I know that the functionality that I ant is provided by Panel Component. But I need it when using component that extends AjaxLink not Panel. I think that one possible reason is to insert the image to my component as a Panel. But that will be very awful reason. Is there any other way how to do it?? Thank for any advice. Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANNOUNCE] Apache Wicket 1.3.5
The Apache Wicket team is proud to announce the availability of the fifth maintenance release: Apache Wicket 1.3.5. A lot of bugs have been squashed and several improvements implemented. It is recommended you update to Wicket 1.3.5 at your earliest convenience. Eager people click here to download the distribution, others can read further: http://www.apache.org/dyn/closer.cgi/wicket/1.3.5 We thank you for your patience and support. - The Wicket Team Apache Wicket Apache Wicket is a component oriented Java web application framework. With proper mark-up/logic separation, a POJO data model, and a refreshing lack of XML, Apache Wicket makes developing web-apps simple and enjoyable again. Swap the boilerplate, complex debugging and brittle code for powerful, reusable components written with plain Java and HTML. You can find out more about Apache Wicket on our website: http://wicket.apache.org This release This release is the fifth maintenance release for the Wicket 1.3 product. This release fixes several bugs and adds some minor improvements. You can find out about the changes at the bottom of this announcement. Migrating from 1.2 If you are coming from Wicket 1.2, you really want to read our migration guide, found on the wiki: http://cwiki.apache.org/WICKET/migrate-13.html Downloading the release You can download the release from the official Apache mirror system, and you can find it through the following link: http://www.apache.org/dyn/closer.cgi/wicket/1.3.5/ For the Maven and Ivy fans out there: update your pom's to the following, and everything will be downloaded automatically: dependency groupIdorg.apache.wicket/groupId artifactIdwicket/artifactId version1.3.5/version /dependency Substitute the artifact ID with the projects of your liking to get the other projects. Please note that we don't prescribe a Logging implementation for SLF4J. You need to specify yourself which one you prefer. Read more about SLF4J here: http://slf4j.org Validating the release The release has been signed by Martijn Dashorst, your release manager for today. The public key can be found in the KEYS file in the download area. Download the KEYS file only from the Apache website. http://www.apache.org/dist/wicket/1.3.5/KEYS Instructions on how to validate the release can be found here: http://www.apache.org/dev/release-signing.html#check-integrity Reporting bugs In case you do encounter a bug, we would appreciate a report in our JIRA: http://issues.apache.org/jira/browse/WICKET The distribution In the distribution you will find a README. The README contains instructions on how to build from source yourself. You also find a CHANEGELOG-1.3 which contains a list of all things that have been fixed, added and/or removed since Wicket 1.3.0. Release Notes - Wicket - Version 1.3.5 ** Sub-task * [WICKET-1805] - Allow to change charset in StringRequestTarget: change CharSet used by the OutStream as well ** Bug * [WICKET-406] - form fields are reset when a file upload fails * [WICKET-431] - Modal window can not be closed after session timeout * [WICKET-622] - Component.toString() is unsafe * [WICKET-625] - Wicket doesn't clean up properly when hot-deploying; hangs onto Class references. * [WICKET-847] - setResponsePage redirects to wrong url * [WICKET-861] - NumberFormatException with UrlCompressingWebRequestProcessor in WicketTester * [WICKET-928] - Exception when clicking two times rapidly on the next button in a wizard * [WICKET-1003] - Modal Window Does Not Close When Using IndicatingAjaxButton * [WICKET-1104] - Modal window sticks to cursor on resize * [WICKET-1120] - Problem closing a ModalWindow when used through an IFrame * [WICKET-1161] - DiskPageStore should write the sessions index file to disk on destroy (from WicketFilter.destroy()) * [WICKET-1205] - Relative path calculations for inline paths in non-bookmarkable pages are incorrect on Tomcat. * [WICKET-1346] - Generated HTML page contains incorrect content when WicketMessage: No get method defined for class * [WICKET-1376] - Using AbstractAjaxTimerBehavior and mounting that page gives exception * [WICKET-1413] - RequestUtils.toAbsolutePath() has a bug regarding to UTF-8 encoded page parameter. * [WICKET-1425] - appendToInit() method is not called in class DatePicker * [WICKET-1437] - Pagemap lock calculates timeout wrong * [WICKET-1449] - './' appended to URL causes HTTP 404 in Internet Explorer (using root context) * [WICKET-1450] - Ajax Re-render does not work after AbstractRestartResponseException() * [WICKET-1471] - FeedbackPanel does not work properly in clustered environment * [WICKET-1478] - AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException * [WICKET-1494] - IntegerConvert cannot handle locale specific input/output * [WICKET-1496] - DataTable.html does not validate (HTML 4.01/XHTML-Strict) * [WICKET-1520] -
RE: CSRF Protection: double submitted cookie
I need to read more about this, but I am interested to know if there are any advantages to storing the token in a cookie for validation rather than putting it into the session. I suppose if statelessness is required then it is necessary. One advantage to storing it in session is that it does help prevent the double form submit error. See http://www.nabble.com/Double-submit-problem-td15957979.html#a15957979 for example. The JIRA issue you mention has a broken link. It looks like it should be http://freedom-to-tinker.com/blog/wzeller/popular-websites-vulnerable-cross-site-request-forgery-attacks If I am not mistaken. -Original Message- From: Jörn Zaefferer [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2008 8:05 AM To: users@wicket.apache.org Subject: Re: CSRF Protection: double submitted cookie I've created a ticket and attached a reference implementation: https://issues.apache.org/jira/browse/WICKET-1885 Jörn On Mon, Oct 20, 2008 at 11:31 PM, Jörn Zaefferer [EMAIL PROTECTED] wrote: The double-submitted-cookie isn't related to double submit protection, no. Thats a completely different turf. With that out of the way, its enough to create just one cookie and use that both while rendering and validating forms. I hope that makes it clearer. I'll try to provide a reference implementation tomorrow. Jörn On Mon, Oct 20, 2008 at 12:58 PM, Johan Compagner [EMAIL PROTECTED] wrote: hmm i will read the paper then I stil dont get it how it is possible with 1 cookie, that then can never change when it is first generated and all the forms also just have that value right? But it is also for double submit protection right? So the cookie has to change right? But how can you then have 1 cookie? for all the forms? If i submit one and that is rerendered or redirected to another page. (so it has a new cookie so the double submit cant happen) But if a new cookie is set then all other forms are also suddenly invalid.. and that looks pretty wrong to me johan On Mon, Oct 20, 2008 at 12:44 PM, Jörn Zaefferer [EMAIL PROTECTED] wrote: No, the cookie is subject to the same-origin-policy, both in reading and writing. The request is authenticated because the session cookie is set, but its invalid when the form itself is missing the value. Combining the attack with XSS would give access to the cookie, but then he could just as well hijack the session directly. In other words: With CSRF alone there is no way for the attacker to read the cookie, therefore its enough to use just one. Their whitepaper may do a better job of explaining the techniquie: http://www.freedom-to-tinker.com/sites/default/files/csrf.pdf Solutions are described on page 8ff. Jörn On Mon, Oct 20, 2008 at 12:33 PM, Johan Compagner [EMAIL PROTECTED] wrote: what i dont get if an attacker wants to submit the form. and it can get to the form it can do the post but you say it cant access the cookie. But if the cookie value is just compared to the form post value we have to make sure that the name of the cookie cant be guessed right? So what should the name be? Because if the name would be wicket-form-uuid then couldnt the attacker also just generate that cookie? I guess there is a cookie per form (there can be many forms on the same page or different active pages) and that cookie must be regenerated/set on every form render? johan On Mon, Oct 20, 2008 at 11:27 AM, Jörn Zaefferer [EMAIL PROTECTED] wrote: Hi, my application currently uses CryptedUrlWebRequestCodingStrategy to protect against CRSF attacks. Afaik 1.3.5 will include an update that generates the key based on user sessions: http://issues.apache.org/jira/browse/WICKET-1782 According to Johan Compagner, there are still issues with that approach, though I don't know if that has been fixed: http://www.nabble.com/Wicket-not-secure--to19556259.html#a19557593 Anyway, the point of this mail is to bring up a different strategy for CSRF protection, the double-submitted-cookie. Discussion of that are here http://www.codinghorror.com/blog/archives/001175.html which links to this article, including a whitepaper: http://freedom-to-tinker.com/blog/wzeller/popular-websites-vulnerable-cross-site-request-forgery-attacks The basic idea is: When a user visits a site, the site should generate a (cryptographically strong) pseudorandom value and set it as a cookie on the user's machine. The site should require every form submission to include this pseudorandom value as a form value and also as a cookie value. When a POST request is sent to the site, the request should only be considered valid if the form value and the cookie value are the same. When an attacker submits a form on behalf of a user, he can only modify the values of the form. An attacker cannot read any data sent from the server or modify cookie values, per the same-origin policy. This means
Re: Wicket and Ext JS integration
I thought there were a licensing issue! Could'nt just remember if it were the guy doing the wicket contrib or ext js.. Martijn Dashorst wrote: The GPL licensing of ExtJS is really a brain damage inflicting mess. Personally I would stay very far away from JS libraries that are GPL licensed (it is not clear how the viral aspect infects your server side code, possibly requiring you to ship your server side code to your users—you *are* distributing the GPL licensed code, which is linked to your product) Martijn -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Wicket AJAX update form TextField value from another field
Hi. Hopefully I can explain this scenario OK - I'll try to keep it simple. On a form, I have a couple of TextFields - SalePrice and DiscountAmount. After the user enters SalePrice, I need a way to allow the user to enter the DiscountAmount as either a flat rate or as a percentage of the SalePrice. For example, if entered SalePrice is 1000, the user could enter a flat DiscountAmount of 200.00. Or they could enter 20%. I'd like the option to do either since SalePrice might be 8,745 and the discount 2.75% or something (so hard to just calculat the true cash amount). Or it might just really be a flat £200 in which case hard to calculate the %. In a traditional app where I'm writing the JavaScript, I can think of various ways to do this involving extra fields for flatrate and/or % - then updating the real DiscountAmount field when the dummy fields change. But I'm trying to work out an elegant way with Wicket/AJAX - without too much success so far. Any suggestions - or links to similar examples? Ideally, the fewer extra dummy fields the better. Thanks. -- View this message in context: http://www.nabble.com/Wicket-AJAX-update-form-TextField-value-from-another-field-tp20117258p20117258.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax validating individual form fields
Just a little update, I managed to get the form level validator working by doing what you said, basically creating a validator that takes a component as an argument, and compares the ivalidatable.value against the model object: protected void onValidate(IValidatable validatable) { if(!validatable.getValue().toString().equals(component.getModelObjectAsString())) error(validatable); } Unfortunately the getResetPassword is a final method for some reason, so I was not able to override it as I hoped. Instead I did this on the ajaxbutton used to submit the form: protected void onAfterRender() { super.onAfterRender(); pass.setResetPassword(false); } protected void onBeforeRender() { super.onBeforeRender(); pass.setResetPassword(true); } And that seemed to work for the password fields. Thanks for your help! -- View this message in context: http://www.nabble.com/Ajax-validating-individual-form-fields-tp20090299p20118595.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket AJAX update form TextField value from another field
Maybe I should have stated I have tried something like this. I have data entry TextFields for: SalePrice DiscountAmount then add another for: DiscountPercentage When I enter an amount into DiscountAmount I need DiscountPercentage to get calculated and update on the form. And it should also work the other way around - enter DiscountPercentage and DiscountAmount gets updated. But DiscountPercentage does not have a setter in my model - just a getter (it's calculated for viewing only and does not get persisted anywhere). So I get errors when Wicket attempts to update the model. And if I enter an an amount in DiscountPercentage and attempt to update the value for DiscountAmount then I can't update this either since I don't want to persist the form until all the other fields are entered. I am using the same form for creating a new record and editing an existing one, so when doing a new record I don't have mandatory fields filled when I'm entering the Discount stuff. Steve steve222 wrote: Hi. Hopefully I can explain this scenario OK - I'll try to keep it simple. On a form, I have a couple of TextFields - SalePrice and DiscountAmount. After the user enters SalePrice, I need a way to allow the user to enter the DiscountAmount as either a flat rate or as a percentage of the SalePrice. For example, if entered SalePrice is 1000, the user could enter a flat DiscountAmount of 200.00. Or they could enter 20%. I'd like the option to do either since SalePrice might be 8,745 and the discount 2.75% or something (so hard to just calculat the true cash amount). Or it might just really be a flat £200 in which case hard to calculate the %. In a traditional app where I'm writing the JavaScript, I can think of various ways to do this involving extra fields for flatrate and/or % - then updating the real DiscountAmount field when the dummy fields change. But I'm trying to work out an elegant way with Wicket/AJAX - without too much success so far. Any suggestions - or links to similar examples? Ideally, the fewer extra dummy fields the better. Thanks. -- View this message in context: http://www.nabble.com/Wicket-AJAX-update-form-TextField-value-from-another-field-tp20117258p20119555.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket AJAX update form TextField value from another field
Steve, If you prefer not to take the easy option and add a couple of radio buttons to let the user select currency or percentage input, that could also control a couple of labels (or a border) that shows, in a locale specific way, the currency symbol or the percentage sign you could ... create an AbsoluteOrPercentage class an instance of which will back the model of your DiscountAmount field. Make a validator that checks that the last character entered looks like an int or a '%' and that the other characters represent a number, and, if required, put your validation messages in the appropriate place. Add this validator to your DiscountAmount text field. Make an appropriate converter (implement IConverter - very simple logic required for both methods) and override getConverter on your text field to return it for your AbsoluteOrPercentage class. If this text field will be useful elsewhere, make a (top level) subclass of TextField - AbsoluteOrPercentageTextField for instance that does all of the above. It is not clear from your post what you want updated, but let's assume you have three fields, one for each of SalePrice, DiscountAmount and ActualAmount (price with discount applied) and you want the latter updated. Add an AjaxFormComponentUpdatingBehavior (probably onblur) to both the input fields. In the onUpdate methods of each update the (dynamic) model object backing the ActualAmount field (probably rendered by a label since it is not meant to be edited by the user). Don't forget to add your actualAmountTextField component to the AjaxRequestTarget in both your onUpdate methods and also to request a markup id for actualAmountTextField - actualAmountField.setMarkupId(true) - where you build up the container. If this lot is likely to be useful elsewhere, wrap all three fields (and probably all the rest of the stuff described above) in a Panel so you can just drop it in a div anywhere you like later on. Does that do it? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk steve222 wrote: Hi. Hopefully I can explain this scenario OK - I'll try to keep it simple. On a form, I have a couple of TextFields - SalePrice and DiscountAmount. After the user enters SalePrice, I need a way to allow the user to enter the DiscountAmount as either a flat rate or as a percentage of the SalePrice. For example, if entered SalePrice is 1000, the user could enter a flat DiscountAmount of 200.00. Or they could enter 20%. I'd like the option to do either since SalePrice might be 8,745 and the discount 2.75% or something (so hard to just calculat the true cash amount). Or it might just really be a flat £200 in which case hard to calculate the %. In a traditional app where I'm writing the JavaScript, I can think of various ways to do this involving extra fields for flatrate and/or % - then updating the real DiscountAmount field when the dummy fields change. But I'm trying to work out an elegant way with Wicket/AJAX - without too much success so far. Any suggestions - or links to similar examples? Ideally, the fewer extra dummy fields the better. Thanks. -- View this message in context: http://www.nabble.com/Wicket-AJAX-update-form-TextField-value-from-another-field-tp20117258p20120021.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Example of pseudo-ajax file uploading using iframes
I have confirmed that the code attached is working great!!! (the attachment is in tar. gzip format. use 7-zip) THANK YOU CARLO! The code is awesome. This feature been bugging for the last week or so. The php side have long been able to do this with their frameworks (using the same technique I believe). This piece should be in the extension package. Thanks again. Carlos Pita-4 wrote: Hi all, here is a hopefully functional example showing how to use an iframe to upload a file and afterwards call a behavior on a component belonging to the top frame, so that an ajax action could be carried on in consequence (maybe to get rid of the iframe, or to show an informative message, or whatever). This is along the same venue as other examples that are around the web, like http://www.air4web.com/files/upload/. I don't have the time to write a proper wiki page just right now, so I simply attach the example here. Hope it helps. Regards, Carlos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Example-of-pseudo-ajax-file-uploading-using-iframes-tp12400088p20120038.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket AJAX update form TextField value from another field
Many thanks for the detailed answer. I don't think the single field AbsoluteOrPercentage idea will work for me without a lot of other changes. I use the same form for editing a record as creating a new one. So I actually need to show both the AbsoluteDiscount and PercentageDiscount on the form at the same time - user enters % during initial entry, he needs to see % on later edit, etc. Both fields need to be editable, with the one that doesn't get edited being calculated. But thanks for the idea and the detail on how to implement this. I've been attempting to do it with separate fields for AbsoluteDiscount and PercentageDiscount - but it does not work for me. My model object used in the form does not have setters for the calculated field PercentageDiscount - just a getter to display the calculated % value. So I can't update this. And it seems I can't update the fields anyway since the need to be final jWeekend wrote: Steve, If you prefer not to take the easy option and add a couple of radio buttons to let the user select currency or percentage input, that could also control a couple of labels (or a border) that shows, in a locale specific way, the currency symbol or the percentage sign you could ... create an AbsoluteOrPercentage class an instance of which will back the model of your DiscountAmount field. Make a validator that checks that the last character entered looks like an int or a '%' and that the other characters represent a number, and, if required, put your validation messages in the appropriate place. Add this validator to your DiscountAmount text field. Make an appropriate converter (implement IConverter - very simple logic required for both methods) and override getConverter on your text field to return it for your AbsoluteOrPercentage class. If this text field will be useful elsewhere, make a (top level) subclass of TextField - AbsoluteOrPercentageTextField for instance that does all of the above. It is not clear from your post what you want updated, but let's assume you have three fields, one for each of SalePrice, DiscountAmount and ActualAmount (price with discount applied) and you want the latter updated. Add an AjaxFormComponentUpdatingBehavior (probably onblur) to both the input fields. In the onUpdate methods of each update the (dynamic) model object backing the ActualAmount field (probably rendered by a label since it is not meant to be edited by the user). Don't forget to add your actualAmountTextField component to the AjaxRequestTarget in both your onUpdate methods and also to request a markup id for actualAmountTextField - actualAmountField.setMarkupId(true) - where you build up the container. If this lot is likely to be useful elsewhere, wrap all three fields (and probably all the rest of the stuff described above) in a Panel so you can just drop it in a div anywhere you like later on. Does that do it? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk steve222 wrote: Hi. Hopefully I can explain this scenario OK - I'll try to keep it simple. On a form, I have a couple of TextFields - SalePrice and DiscountAmount. After the user enters SalePrice, I need a way to allow the user to enter the DiscountAmount as either a flat rate or as a percentage of the SalePrice. For example, if entered SalePrice is 1000, the user could enter a flat DiscountAmount of 200.00. Or they could enter 20%. I'd like the option to do either since SalePrice might be 8,745 and the discount 2.75% or something (so hard to just calculat the true cash amount). Or it might just really be a flat £200 in which case hard to calculate the %. In a traditional app where I'm writing the JavaScript, I can think of various ways to do this involving extra fields for flatrate and/or % - then updating the real DiscountAmount field when the dummy fields change. But I'm trying to work out an elegant way with Wicket/AJAX - without too much success so far. Any suggestions - or links to similar examples? Ideally, the fewer extra dummy fields the better. Thanks. -- View this message in context: http://www.nabble.com/Wicket-AJAX-update-form-TextField-value-from-another-field-tp20117258p20120528.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket AJAX update form TextField value from another field
Ooops - my error. I need to do something like: pcntDiscount.setModel(new Model(amount.getModelObject().toString())); Then the AjaxFormComponentUpdatingBehavior works as expected. Steve steve222 wrote: Many thanks for the detailed answer. I don't think the single field AbsoluteOrPercentage idea will work for me without a lot of other changes. I use the same form for editing a record as creating a new one. So I actually need to show both the AbsoluteDiscount and PercentageDiscount on the form at the same time - user enters % during initial entry, he needs to see % on later edit, etc. Both fields need to be editable, with the one that doesn't get edited being calculated. But thanks for the idea and the detail on how to implement this. I've been attempting to do it with separate fields for AbsoluteDiscount and PercentageDiscount - but it does not work for me. My model object used in the form does not have setters for the calculated field PercentageDiscount - just a getter to display the calculated % value. So I can't update this with AjaxFormComponentUpdatingBehavior. And it seems I can't update the fields using AjaxEventBehavior, eg: final RequireTextfield amount = new RequiredTextfield(amount, Double.class); amount.add(DoubleMinimumValidator.minimum(1)); amount.setOutputMarkupId(true); container.add(amount); amount.add(new AjaxEventBehavior(onblur) { protected void onEvent(AjaxRequestTarget target) { // this will always be null on new data entry, and old value on edit pcntDiscount.setModelObject(amount.getModelObject().toString()); target.addComponent(pcntDiscount); } }); jWeekend wrote: Steve, If you prefer not to take the easy option and add a couple of radio buttons to let the user select currency or percentage input, that could also control a couple of labels (or a border) that shows, in a locale specific way, the currency symbol or the percentage sign you could ... create an AbsoluteOrPercentage class an instance of which will back the model of your DiscountAmount field. Make a validator that checks that the last character entered looks like an int or a '%' and that the other characters represent a number, and, if required, put your validation messages in the appropriate place. Add this validator to your DiscountAmount text field. Make an appropriate converter (implement IConverter - very simple logic required for both methods) and override getConverter on your text field to return it for your AbsoluteOrPercentage class. If this text field will be useful elsewhere, make a (top level) subclass of TextField - AbsoluteOrPercentageTextField for instance that does all of the above. It is not clear from your post what you want updated, but let's assume you have three fields, one for each of SalePrice, DiscountAmount and ActualAmount (price with discount applied) and you want the latter updated. Add an AjaxFormComponentUpdatingBehavior (probably onblur) to both the input fields. In the onUpdate methods of each update the (dynamic) model object backing the ActualAmount field (probably rendered by a label since it is not meant to be edited by the user). Don't forget to add your actualAmountTextField component to the AjaxRequestTarget in both your onUpdate methods and also to request a markup id for actualAmountTextField - actualAmountField.setMarkupId(true) - where you build up the container. If this lot is likely to be useful elsewhere, wrap all three fields (and probably all the rest of the stuff described above) in a Panel so you can just drop it in a div anywhere you like later on. Does that do it? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk steve222 wrote: Hi. Hopefully I can explain this scenario OK - I'll try to keep it simple. On a form, I have a couple of TextFields - SalePrice and DiscountAmount. After the user enters SalePrice, I need a way to allow the user to enter the DiscountAmount as either a flat rate or as a percentage of the SalePrice. For example, if entered SalePrice is 1000, the user could enter a flat DiscountAmount of 200.00. Or they could enter 20%. I'd like the option to do either since SalePrice might be 8,745 and the discount 2.75% or something (so hard to just calculat the true cash amount). Or it might just really be a flat £200 in which case hard to calculate the %. In a traditional app where I'm writing the JavaScript, I can think of various ways to do this involving extra fields for flatrate and/or % - then updating the real DiscountAmount field when the dummy fields change. But I'm trying to work out an elegant way with Wicket/AJAX - without too much success so far. Any suggestions - or links to similar examples? Ideally, the fewer extra dummy fields the better. Thanks. -- View
Re: Wicket AJAX update form TextField value from another field
But not for the field where the model does not have a setter (hibernate POJO - and no field in the database, just a formula). Fairly obvious why that's not going to work for an update - but I can't think of a solution on how to change the calculated value just to show it on the form. Steve steve222 wrote: Ooops - my error. I need to do something like: pcntDiscount.setModel(new Model(amount.getModelObject().toString())); Then the AjaxFormComponentUpdatingBehavior works as expected. Steve steve222 wrote: Many thanks for the detailed answer. I don't think the single field AbsoluteOrPercentage idea will work for me without a lot of other changes. I use the same form for editing a record as creating a new one. So I actually need to show both the AbsoluteDiscount and PercentageDiscount on the form at the same time - user enters % during initial entry, he needs to see % on later edit, etc. Both fields need to be editable, with the one that doesn't get edited being calculated. But thanks for the idea and the detail on how to implement this. I've been attempting to do it with separate fields for AbsoluteDiscount and PercentageDiscount - but it does not work for me. My model object used in the form does not have setters for the calculated field PercentageDiscount - just a getter to display the calculated % value. So I can't update this with AjaxFormComponentUpdatingBehavior. And it seems I can't update the fields using AjaxEventBehavior, eg: final RequireTextfield amount = new RequiredTextfield(amount, Double.class); amount.add(DoubleMinimumValidator.minimum(1)); amount.setOutputMarkupId(true); container.add(amount); amount.add(new AjaxEventBehavior(onblur) { protected void onEvent(AjaxRequestTarget target) { // this will always be null on new data entry, and old value on edit pcntDiscount.setModelObject(amount.getModelObject().toString()); target.addComponent(pcntDiscount); } }); jWeekend wrote: Steve, If you prefer not to take the easy option and add a couple of radio buttons to let the user select currency or percentage input, that could also control a couple of labels (or a border) that shows, in a locale specific way, the currency symbol or the percentage sign you could ... create an AbsoluteOrPercentage class an instance of which will back the model of your DiscountAmount field. Make a validator that checks that the last character entered looks like an int or a '%' and that the other characters represent a number, and, if required, put your validation messages in the appropriate place. Add this validator to your DiscountAmount text field. Make an appropriate converter (implement IConverter - very simple logic required for both methods) and override getConverter on your text field to return it for your AbsoluteOrPercentage class. If this text field will be useful elsewhere, make a (top level) subclass of TextField - AbsoluteOrPercentageTextField for instance that does all of the above. It is not clear from your post what you want updated, but let's assume you have three fields, one for each of SalePrice, DiscountAmount and ActualAmount (price with discount applied) and you want the latter updated. Add an AjaxFormComponentUpdatingBehavior (probably onblur) to both the input fields. In the onUpdate methods of each update the (dynamic) model object backing the ActualAmount field (probably rendered by a label since it is not meant to be edited by the user). Don't forget to add your actualAmountTextField component to the AjaxRequestTarget in both your onUpdate methods and also to request a markup id for actualAmountTextField - actualAmountField.setMarkupId(true) - where you build up the container. If this lot is likely to be useful elsewhere, wrap all three fields (and probably all the rest of the stuff described above) in a Panel so you can just drop it in a div anywhere you like later on. Does that do it? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk steve222 wrote: Hi. Hopefully I can explain this scenario OK - I'll try to keep it simple. On a form, I have a couple of TextFields - SalePrice and DiscountAmount. After the user enters SalePrice, I need a way to allow the user to enter the DiscountAmount as either a flat rate or as a percentage of the SalePrice. For example, if entered SalePrice is 1000, the user could enter a flat DiscountAmount of 200.00. Or they could enter 20%. I'd like the option to do either since SalePrice might be 8,745 and the discount 2.75% or something (so hard to just calculat the true cash amount). Or it might just really be a flat £200 in which case hard to calculate the %. In a traditional app where I'm writing the JavaScript, I can think of various ways to do this involving extra fields for
Re: Static injection not working (wicket-guice)
Anyone for this? Edgar Merino escribió: Hello, I've been trying to inject a service to some classes that are not wicket components, I've asked here and was suggested to use static injection: InjectorHolder.getInjector().inject(this); however this is not working with guice, I always get an illegalstateexception, injectorholder has not been assigned an injector. I've tried ((GuiceInjectorHolder) (RequestCycle.get().getApplication().getMetaData(GuiceInjectorHolder.INJECTOR_KEY))).getInjector().injectMembers(this); however that gives me serialization problems, since wicket is not creating a proxy for my service. I'm on my way to give salve a try but I'm having some problems there too (waiting for a response from the Discussion group), what suggestions can you make? Thanks in advance, Edgar Merino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to add item to repeater without updating all items
hi, I have an AbstractRepeater, and I want to add an item to the repeater and display it without updating all the items in the repeater. When I try AjaxRequestTarget.addComponent(newItem) I get the following error: Unable to find the markup for the component. That may be due to transparent containers or components implementing IComponentResolver I am willing to try *anything* to get this to work. This bug related attempt to get a list that is ajax refreshed just at the tail, but I don't know how to re-use the solution. https://issues.apache.org/jira/browse/WICKET-841 We've come up with a few design for repeaters that allow adding an individual item without repainting the whole thing. However, they are kinda complex and was wondering if someone already knows how to do it. -- View this message in context: http://www.nabble.com/How-to-add-item-to-repeater-without-updating-all-items-tp20122998p20122998.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Associating a request to a Session
On Tue, 2008-09-23 at 20:50 -0700, Igor Vaynberg wrote: wicket does not associate a request with a session. wicket uses httpsession to store its own session object. what you want is to know how the servlet container associates a request with http session. usually that is done with the jsessionid cookie or by appending jsessionid into the url. I tried playing around with this, but was not successful. Essentially, I appended the jsessionid parameter into the url (and various other things related to jessionid), but I guess the container is too smart for that trick. I was not able to succeed that way. Before I dig into the container implementation (which I would prefer to avoid), does anybody have any suggestions about how I can somehow return to the original session, or at least copy over the state of the old session into the new session in a clean way? Thank you! =dml - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Associating a request to a Session
Before I dig into the container implementation (which I would prefer to avoid), does anybody have any suggestions about how I can somehow return to the original session, or at least copy over the state of the old session into the new session in a clean way? Actually, the only thing I want to do is continueToOriginalDestination(). So maybe I can just copy the state of this originalDestination from the original session into the new one? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: redirect issue on IE causing HTTP 4040
create a quickstart that reproduces this and attach it to a jira issue. -igor On Wed, Oct 22, 2008 at 9:27 PM, freak182 [EMAIL PROTECTED] wrote: Hello Igor, I have a problem in IE when i redirect wicket pages using javascript using location.href = '?wicket:interface=:3' . here is the scenario: public class InitBehavior extends AbstractBehavior { final IModel params = new AbstractReadOnlyModel() { @Override public Object getObject() { // redirect url's map.put(roamUrl, RequestCycle.get().urlFor(NoIdPage.class, null)); map.put(loginUrl, RequestCycle.get().urlFor(new LoginPage())); map.put(errorUrl, RequestCycle.get().urlFor(new ErrorPage())); return map; } }; component.add(TextTemplateHeaderContributor.forJavaScript( InitBehavior.class, init.js, params)); super.bind(component); } ... } and in init.js function clientReady() { // detect if arcot id exist if (!IDExists(strWFUserID)) { if (Flag) { // document.getElementById('divErrPopup').style.display = 'block'; location.href = '${errorUrl}'; } else { location.href = '${roamUrl}'; } } else { location.href = '${loginUrl}'; } } this script is executed upon loading of the page. This working fine in firefox. im using wicket 1.3.4 i also try the latest release 1.3.5 but it still problem in IE(http://localhost:8080/test/undefined). I also, mount(new QueryStringUrlCodingStrategy(noid, NoIdPage.class)); again this works only in firefox but not in IE. since our client mostly IE users. i also found this bug https://issues.apache.org/jira/browse/WICKET-1449 ... How can i solve this problem? Is there a work around to this? Thanks a lot. Cheers. -- View this message in context: http://www.nabble.com/redirect-issue-on-IE-causing-HTTP-4040-tp20124228p20124228.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
GMAP2 with Wicket AjaxTabbedPanel
Im having a most strange problem and im wondering if anyone has a fix at all. I have a series of ajax tabbed panels one of which is supposed to show a gmap2 google map. For some totally bizarre reason, the tab blows up with the following error ... ERROR org.apache.wicket.RequestCycle - Too many path parts, please provide sufficient number of path parameter names Now, ive inspected the URI and noticed that the bookmarkable page link has some weird googlemap url appended to it, and hence makes the bookmarkable link seem to have more parameters then the mount statement declares. So ... URI SHOULD be /V/2/ON/Color/Brown/ But is coming out as /V/2/ON/Color/Brown/http://www.google.com/jsapi I have no idea at all why this is occurring. If the same components are stored outside the tabbedpanel, then its all fine. Has anyone come across this, or does anyone have a workaround ? Many thanks in advance. -- View this message in context: http://www.nabble.com/GMAP2-with-Wicket-AjaxTabbedPanel-tp20124469p20124469.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass parameters to a BreadCrumbPanel
Hi Naveen, I do it something like this: TabbedPanel tabbedPanel = new TabbedPanel(tabs, tabs){ @Override protected WebMarkupContainer newLink(String linkId, final int index) { PageParameters parameters = new PageParameters(); parameters.put(selected, ((ITab) getTabs().get(index)) .getTitle().getObject()); parameters.put(somethingIneedID, somethingIneedID); return new BookmarkablePageLink(linkId, MyPage.class, parameters); } }; if (found) tabbedPanel.setSelectedTab(selected); if (tabSelect != null) tabbedPanel.setSelectedTab(tabSelect); add(tabbedPanel); you should be able to figue it out from there. Wayne On Tue, Oct 21, 2008 at 9:06 PM, Nav Che [EMAIL PROTECTED] wrote: Hello All, How do i pass parameters between panels. Basically i have panels in my appilcation which use breadcrumb model. Say on panel A i display list of users and I want the user Id to be a link upon clickin it should show the edit panel ( panel B ) of user and for which it shld either pass user object or userid. Please advise. Thanks in advance Regards naveen
Re: Wicket AJAX update form TextField value from another field
Thanks. I now have this fully working now with a customised model class containing a setter to store the calculated field if upated from the Wicket form. Will look at FormComponentPanel - thanks for the suggestion. Steve Timo Rantalaiho wrote: On Wed, 22 Oct 2008, steve222 wrote: But DiscountPercentage does not have a setter in my model - just a getter (it's calculated for viewing only and does not get persisted anywhere). So I get errors when Wicket attempts to update the model. I would have done this by using customised models, but a while back in a similar discussion on this list Igor suggested using FormComponentPanel. You can probably solve your situation with it. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Wicket-AJAX-update-form-TextField-value-from-another-field-tp20117258p20124799.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]