Re: Best practice sought: Register client change at server

2014-07-11 Thread Sven Meier
an AjaxEventBehavior, but I don't have a component to attach it to. You have a page, don't you? Otherwise you can request a resource via Ajax too. Regards Sven On 07/11/2014 02:47 AM, Joachim Schrod wrote: Hi, In a Wicket application I have JQuery code that triggers after a certain time

Re: equals() method for LoadableDetachableModels

2014-07-11 Thread Sven Meier
Hi, detachable models should never use getObject() in their implementation of equals()? generally this is a good advice: there are several places in Wicket checking for model equality (e.g. ReuseIfModelsEqualStrategy). A detachable model should have enough information to decide equality

Re: equals() method for LoadableDetachableModels

2014-07-11 Thread Ernesto Reinaldo Barreiro
Hi, On Fri, Jul 11, 2014 at 9:51 AM, Sven Meier s...@meiers.net wrote: Hi, detachable models should never use getObject() in their implementation of equals()? generally this is a good advice: there are several places in Wicket checking for model equality (e.g.

Re: equals() method for LoadableDetachableModels

2014-07-11 Thread Martin Grigorov
Hi, I agree that using the primary key should be enough for #equals() but does org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream#check() really need to use #equals() (via Stack#contains()) ? I think checking for identity equality should be OK too. Java Serialization is not

Re: base pages without kludge initialization

2014-07-11 Thread Martin Grigorov
I'm 50/50 here. I agree that it will make it simpler for your use case but in the same time it will make it possible to expose the parameters+model constructor as public in YourPage and the problem will become a RuntimeException while at the moment it is just not possible (i.e. a compile error).

Re: Best practice sought: Register client change at server

2014-07-11 Thread Martin Grigorov
page.add(new AjaxEventBehavior(my-special-event) {...}); in JS code: jQuery(document).triggerHandler('my-special-event'); Voila! Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Jul 11, 2014 at 10:15 AM, Sven Meier s...@meiers.net wrote: an

Re: Best practice sought: Register client change at server

2014-07-11 Thread Joachim Schrod
On 07/11/14 04:44, Ernesto Reinaldo Barreiro wrote: On Fri, Jul 11, 2014 at 2:47 AM, Joachim Schrod jsch...@acm.org wrote: An AjaxEventBehavior would be the right thing, but I don't have a component to attach it to. The worst solution would be a hidden AjaxLink. IMO I simply need to establish

Re: Best practice sought: Register client change at server

2014-07-11 Thread Joachim Schrod
I didn't know that I can introduce my own event names, I thought I had to use one of the pre-defined ones. Thanks for that enlightenment, it works like a charm. Joachim On 07/11/14 12:01, Martin Grigorov wrote: page.add(new AjaxEventBehavior(my-special-event) {...}); in JS code:

Re: equals() method for LoadableDetachableModels

2014-07-11 Thread Boris Goldowsky
Thank you all for your replies, very helpful! Sven Meier s...@meiers.netmailto:s...@meiers.net wrote: detachable models should never use getObject() in their implementation of equals()? generally this is a good advice: there are several places in Wicket checking for model equality (e.g.

Re: equals() method for LoadableDetachableModels

2014-07-11 Thread Sven Meier
Hi, really need to use #equals() ... checking for identity equality should be OK too I've just tried with an IdentityHashMap and all tests passed (except SerializableCheckerTest#runtimeExceptionTolerance() of course). Sven On 07/11/2014 11:39 AM, Martin Grigorov wrote: Hi, I agree that

Validate FormComponent raw input before conversion

2014-07-11 Thread Jack Berg
Hello! I have textfield backed by Integer Model object in the web app and a number field in the database. The maximum number the database can hold is less than Integer.MAX_VALUE so I have added a validator which checks that and reports the valid range. The problem is that when the user enters a