Re: Migration issue: code using MarkupStream.findCOmponentINdex

2013-02-14 Thread Martin Dietze
On Wed, February 13, 2013, Francois Meillet wrote: private boolean hasFragment(final String id, final Markup markup) { return markup.find(id) != null; } hope this help Thanks a lot! M'bert -- --- / http://herbert.the-little-red-haired-girl.org / - =+= Old

Re: AjaxEventBehavior called twice because of javascript onchange

2013-02-14 Thread sauli.ketola
Hi, Could you instead use this: See http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.html#setNullValid%28boolean%29 If set to false, then Choose One will be displayed when the value is null. After a value is selected, and that change is

Re: How to null-check manually converted TextField values?

2013-02-14 Thread Fred!!!
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

Re: Test Select2Choice with WicketTester

2013-02-14 Thread Ulf Gitschthaler
In most cases I want to simulate a user typing something in and selecting one of the offered choices. Afterwards I'd also like to submit the form and check if the model object of the Select2Choice field contains the right value, respectively I want to be able to submit the form if a

Re: How to null-check manually converted TextField values?

2013-02-14 Thread Sebastian Gaul
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

Twenty-Six Wicket Tricks Book

2013-02-14 Thread Sebastian Gaul
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?

DropDownChoice not updating model

2013-02-14 Thread Lucio Crusca
Hello *, I have a FormComponentPanel derived class that uses a DropDownChoice with a ChoiceRenderer. The DropDownChoice id matches the field name in my model class and I use a CompountPropertyModel wrapping my model instance for the component. Code snippets: class StreetAddress ... private

Re: DropDownChoice not updating model

2013-02-14 Thread Ernesto Reinaldo Barreiro
I don't know if this has anything to do... but make sure class StreetAddress implements equals On Thu, Feb 14, 2013 at 11:55 AM, Lucio Crusca lu...@sulweb.org wrote: Hello *, I have a FormComponentPanel derived class that uses a DropDownChoice with a ChoiceRenderer. The DropDownChoice id

Re: DropDownChoice not updating model

2013-02-14 Thread Sven Meier
If you use objects without overriden #equals() and #hashcode() and DropDownChoice you have several options: 1) use a custom ChoiceRenderer 2) override AbstractSingleSelectChoice#getModelValue() 3) make sure the selected choice is the identical object contained in the choices list (e.g. via

Re: DropDownChoice not updating model

2013-02-14 Thread Ernesto Reinaldo Barreiro
Thanks for pointing that out! On Thu, Feb 14, 2013 at 12:21 PM, Sven Meier s...@meiers.net wrote: If you use objects without overriden #equals() and #hashcode() and DropDownChoice you have several options: 1) use a custom ChoiceRenderer 2) override

Re: DropDownChoice not updating model

2013-02-14 Thread Lucio Crusca
In data giovedì 14 febbraio 2013 12:21:58, Sven Meier ha scritto: On 02/14/2013 12:01 PM, Ernesto Reinaldo Barreiro wrote: I don't know if this has anything to do... but make sure class StreetAddress implements equals If you use objects without overriden #equals() and #hashcode() and

Re: DropDownChoice not updating model

2013-02-14 Thread Sven Meier
Then the DropDownChoice should work fine. Try to create a quickstart please. Sven On 02/14/2013 12:53 PM, Lucio Crusca wrote: In data giovedì 14 febbraio 2013 12:21:58, Sven Meier ha scritto: On 02/14/2013 12:01 PM, Ernesto Reinaldo Barreiro wrote: I don't know if this has anything to do...

Re: Test Select2Choice with WicketTester

2013-02-14 Thread Ulf Gitschthaler
Thanks for your answer, I'll try this out today. On Feb 14, 2013, at 11:53 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Hi, On Thu, Feb 14, 2013 at 10:12 AM, Ulf Gitschthaler ulf.gitschtha...@comsysto.com wrote: In most cases I want to simulate a user typing something in

Redirect to the HomePage on newSession

2013-02-14 Thread vov
Is it possible to redirect user to the HomePage when new session is created? @Override public Session newSession(Request request, Response response) { //RequestCycle.get().setResponsePage(getHomePage()); //or //RequestCycle.get().replaceAllRequestHandlers(new RenderPageRequestHandler(new

Behavior.renderHead stopped working after migration from 1.4 to 6.5

2013-02-14 Thread Artur
Hi Guys, We just migrated our code to W6.5 and are very happy about it. Unfortunately we don't know how to fix one of the errors. We did a research but cannot find a solution :( The code adds a link before a component with some javascript: private class ChangeDateBehavior extends

Re: Twenty-Six Wicket Tricks Book

2013-02-14 Thread Ian Marshall
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

Re: Redirect to the HomePage on newSession

2013-02-14 Thread Andrea Del Bene
Hi, try using session listener interface ISessionListener. This entity defines method onCreated called after a new session ahas been created. To register a custom session listener use the following code in application class: public void init(){ super.init(); ISessionListener

Re: Behavior.renderHead stopped working after migration from 1.4 to 6.5

2013-02-14 Thread Ernesto Reinaldo Barreiro
Hi, a id=from2059--lthref=# onclick=changeDate('from2059'**, -1)\/a ins't exactly proper JavaScript. What do you want to achieve? Apend that HTML to component's HTML? On Thu, Feb 14, 2013 at 2:41 PM, Artur a_wron...@gazeta.pl wrote: Hi Guys, We just migrated our code to W6.5 and are very

Forward request to an external filter

2013-02-14 Thread Leonid Bogdanov
Hello!   I'm trying to add OAuth authentication to a Wicket webapp and as a part of this I need to be able to do server-side forward of a request from Wicket to an external filter.   So what is the best way to do this in Wicket? Do I need to throw some special exception with an URL to forward

Re: HttpsMapper with Apache Virtual Host Appending the Wrong Path

2013-02-14 Thread Tim Urberg
One last time, I found a bug in the code I had below, here's the fixed version: @Override protected String createRedirectUrl(IRequestHandler handler, Request request, Scheme scheme) { HttpServletRequest req = (HttpServletRequest) ((WebRequest) request).getContainerRequest();

Re: Behavior.renderHead stopped working after migration from 1.4 to 6.5

2013-02-14 Thread Artur
On 2013-02-14 15:13, Ernesto Reinaldo Barreiro wrote: Hi, a id=from2059--lthref=# onclick=changeDate('from2059'**, -1)\/a ins't exactly proper JavaScript. What do you want to achieve? Apend that HTML to component's HTML? You are of course right. Yes, I know that is not a valid javascript but

6.0 Migration issue: wrap Wicket Ajax JS-code as previously with AjaxCallDecorators

2013-02-14 Thread Martin Dietze
In the project I'm currently migrating from Wicket 1.4 to 6.6 I have a few pieces of code where AjaxCallDecorator instances would wrap the Wicket-genrated JS code as shown in this little example: | return new AjaxCallDecorator() { | | @Override | public CharSequence decorateScript(

Re: 6.0 Migration issue: wrap Wicket Ajax JS-code as previously with AjaxCallDecorators

2013-02-14 Thread Fred!!!
Hi Martin, it's possible to set an throtteling delay by Wicket AjaxRequestAttributes. Have a look at https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax#WicketAjax-AjaxRequestAttributes Something like this: new AjaxEventBehavior(onkeydown){ void

Re: how to modify internal JavascriptResourceReference packaged with component

2013-02-14 Thread Francois Meillet
Hi Evan, try this private static final ResourceReference YOURJS = new JavaScriptResourceReference( YourClassWhereJavascriptReside.js.class, YourModifiedJavascript.js); @Override public void renderHead(IHeaderResponse response) {

Several Form onSubmit, is it possible add via AbstractBehavior?

2013-02-14 Thread Alex
Hi. I have AjaxFallbackButton on the form with defined onSubmit handler. There also one custom AbstractBehavior added to the form. This Behavior does some action with form's components (add event handlers for form's text controls) and next should intercept form's onSubmit event to do some action

Re: Redirect to the HomePage on newSession

2013-02-14 Thread vov
Hi, unfortunately it does not help. Use session listener roughly the same with using newSession method. I found one solution but looks like workaround without a real needed. 1) throw CustomExceprion on the onCreated method of the ISessionListener. 2) Replace DefaultExceptionMapperProvider with