Re: Redirect to relative URL
This is exactely what I tried. The problem is, that RedirectRequestTarget handles the URL as context-specific (but it is domain-specific). Using external links (as mentioned on the website) is not an option, because the redirect is based on internal settings rather than user interaction. Any other idea? 2013/2/22 Bernard bht...@gmail.com You will find solutions under these subjects: redirect to an external non-Wicket page redirect to an external URL e.g. https://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html Regards, Bernard On Fri, 22 Feb 2013 17:06:09 +0100, you wrote: Hello, I have a server-relative URL like /target/index (starting with a slash) and I'm looking for a way to redirect to http://mydomain.com*/target/index*. In Wicket (unfortunately still 1.4) I tried the following: RequestCycle.get().setRequestTarget( new RedirectRequestTarget(/target/index) ); Unfortunately Wicket thinks that the root slash refers to the Wicket application rather than the server's root. Therefore the redirect ends up here: http://mydomain.com/*wicketapp*/target/index * * I don't want Wicket to change my URL, so the Servlet should redirect to http://mydomain.com/target/index. Any ideas how to achieve that? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Redirect to relative URL
Hello, I have a server-relative URL like /target/index (starting with a slash) and I'm looking for a way to redirect to http://mydomain.com*/target/index*. In Wicket (unfortunately still 1.4) I tried the following: RequestCycle.get().setRequestTarget( new RedirectRequestTarget(/target/index) ); Unfortunately Wicket thinks that the root slash refers to the Wicket application rather than the server's root. Therefore the redirect ends up here: http://mydomain.com/*wicketapp*/target/index * * I don't want Wicket to change my URL, so the Servlet should redirect to http://mydomain.com/target/index. Any ideas how to achieve that?
Re: Twenty-Six Wicket Tricks Book
If somebody else wants to know it: He is not planning to finish his book. In fact, he never really started writing it: http://codeact.wordpress.com/coding/comment-page-1/#comment-85 2013/2/15 Ian Marshall ianmarshall...@gmail.com You could always visit the Coding: On Software Design Process section of Jonathan's blog (it's an excellent book, by the way) and ask him your question from there. Ian Sebastian Gaul wrote I cannot find anything related there. His blog started long after the book. Am 14.02.2013 14:51 schrieb Ian Marshall lt; IanMarshall.UK@ gt;: Perhaps a good source of information is Jonathan's blog at: http://codeact.wordpress.com lt;http://codeact.wordpress.comgt; Ian Sebastian Gaul wrote Does anyone know what happened to the book Twenty-Six Wicket Tricks by Jonathan Locke? Some code looks very promising and I would like to read it. However, the code seems to be very old and I cannot find any way to purchase the book. Is the project still alive? http://code.google.com/p/twenty-six-wicket-tricks/ - To unsubscribe, e-mail: users-unsubscribe@.apache For additional commands, e-mail: users-help@.apache -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656367.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscribe@.apache For additional commands, e-mail: users-help@.apache -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656414.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty-Six Wicket Tricks Book
I cannot find anything related there. His blog started long after the book. Am 14.02.2013 14:51 schrieb Ian Marshall ianmarshall...@gmail.com: Perhaps a good source of information is Jonathan's blog at: http://codeact.wordpress.com http://codeact.wordpress.com Ian Sebastian Gaul wrote Does anyone know what happened to the book Twenty-Six Wicket Tricks by Jonathan Locke? Some code looks very promising and I would like to read it. However, the code seems to be very old and I cannot find any way to purchase the book. Is the project still alive? http://code.google.com/p/twenty-six-wicket-tricks/ - To unsubscribe, e-mail: users-unsubscribe@.apache For additional commands, e-mail: users-help@.apache -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656367.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to null-check manually converted TextField values?
Thanks Fred, that's what I found yesterday night after hours of searching, too. However, I think I'll go with Sebastiens approach, because it unifies converter and validation check. Thanks to both of you! 2013/2/14 Fred!!! schreibf...@googlemail.com: Hi, an other solution is to add a NullAcceptingValidator to your Textfield. Thus wicket will pass to IValidator.validate(IValidatable) See http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/validation/INullAcceptingValidator.html Cheers Fred Am 14.02.2013 00:55, schrieb Sebastien: Hi, Well, the required flag ensures that the input is not empty, not that it is of the correct type... If the conversion fails, is it supposed (I guessed) to throw a ConversionException. As it seems to not be the case, I would have overridden convert input as follow (not tested): class MyJodaDateTextField { protected void convertInput() { super.convertInput(); Date value = this.getConvertedInput(); if (value == null) { //handles the error message ValidationError error = new ValidationError(); error.addKey(MyJodaDateTextField.ConversionError); //wicket6 //error.addMessageKey(MyJodaDateTextField.ConversionError); //wicket1.5 error.setVariable(date, value); this.error(error); } } } MyJodaDateTextField.properties will contain: MyJodaDateTextField.ConversionError='${date}' is not a valid Joda datetime Also pay attention to check the type in getConverter { if (Date.class.isAssignableFrom(type)) { return (IConverterC)new JodaDateTimeConverter(); } return super.getConverter(type); } Hope this helps, Sebastien. On Wed, Feb 13, 2013 at 4:46 PM, Sebastian Gaul sebast...@mgvmedia.comwrote: I have a TextField which overrides it's getConverter method to add a Joda time converter instead: new TextFieldP(id) { @Override public P IConverterP getConverter(ClassP type) { return (IConverterP) new JodaDateTimeConverter(); } }; The converter returns null if input was invalid. However, I want to be able to flag this field as required, and I don't know how to do that: - textField.isRequired(true) does not work, because required checks are done before conversion. This doesn't work for non-empty but invalid inputs. - textField.add(.. some validator ..) does not work because no validator is called if the converter returned null. I really don't see an approach to flag my date fields as required. Do you know how to do that? Probably my approach is not suited at all? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Twenty-Six Wicket Tricks Book
Does anyone know what happened to the book Twenty-Six Wicket Tricks by Jonathan Locke? Some code looks very promising and I would like to read it. However, the code seems to be very old and I cannot find any way to purchase the book. Is the project still alive? http://code.google.com/p/twenty-six-wicket-tricks/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to null-check manually converted TextField values?
I have a TextField which overrides it's getConverter method to add a Joda time converter instead: new TextFieldP(id) { @Override public P IConverterP getConverter(ClassP type) { return (IConverterP) new JodaDateTimeConverter(); } }; The converter returns null if input was invalid. However, I want to be able to flag this field as required, and I don't know how to do that: - textField.isRequired(true) does not work, because required checks are done before conversion. This doesn't work for non-empty but invalid inputs. - textField.add(.. some validator ..) does not work because no validator is called if the converter returned null. I really don't see an approach to flag my date fields as required. Do you know how to do that? Probably my approach is not suited at all? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org