You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Erik de Hair <er...@pocos.nl> on 2014/06/10 13:15:05 UTC
updating() lifecycle callback
Hi,
Do I have to do more than creating a lifecycle callback method "public void updating()" to do some actions just before updating to the database? It looks like the updating()-method is never called after using the edit-button in the wicket viewer. I can see the object being updated in the logs.
Thanks,
Erik
Re: updating() lifecycle callback
Posted by Erik de Hair <er...@pocos.nl>.
Hi Dan, Jeroen,
I believe both your methods work for us. I'll think about what option is the best for this case. Thanks for your replies.
Erik
On 06/10/2014 02:35 PM, Jeroen van der Wal wrote:
Personally I'm not a fan of using the lifecycle events. The pattern
that works best for us is to disable the edit button (by using
@Immutable) and only make changes through actions. This makes the
behaviour of the application more predictable and allows easier
testing, validation and auditing.
Cheers,
Jeroen
On Tue, Jun 10, 2014 at 1:19 PM, Dan Haywood
<da...@haywood-associates.co.uk> wrote:
There was a bug raised about this recently, so it may well be broken (ie
never made to work with the JDO objectstore). Should be fixable.
In the meantime, however, an alternative (and probably better) is to use
the new EventBus stuff, @PostsPropertyChangedEvent and the other @PostsXxx
annotations. This will allow you to decouple the changes to some other
service (rather than making it a responsibility of the object being
updated).
Will that work in your case?
Dan
On 10 June 2014 12:15, Erik de Hair <er...@pocos.nl> wrote:
Hi,
Do I have to do more than creating a lifecycle callback method "public
void updating()" to do some actions just before updating to the database?
It looks like the updating()-method is never called after using the
edit-button in the wicket viewer. I can see the object being updated in the
logs.
Thanks,
Erik
Re: updating() lifecycle callback
Posted by Jeroen van der Wal <je...@stromboli.it>.
Personally I'm not a fan of using the lifecycle events. The pattern
that works best for us is to disable the edit button (by using
@Immutable) and only make changes through actions. This makes the
behaviour of the application more predictable and allows easier
testing, validation and auditing.
Cheers,
Jeroen
On Tue, Jun 10, 2014 at 1:19 PM, Dan Haywood
<da...@haywood-associates.co.uk> wrote:
> There was a bug raised about this recently, so it may well be broken (ie
> never made to work with the JDO objectstore). Should be fixable.
>
> In the meantime, however, an alternative (and probably better) is to use
> the new EventBus stuff, @PostsPropertyChangedEvent and the other @PostsXxx
> annotations. This will allow you to decouple the changes to some other
> service (rather than making it a responsibility of the object being
> updated).
>
> Will that work in your case?
>
> Dan
>
>
>
>
>
> On 10 June 2014 12:15, Erik de Hair <er...@pocos.nl> wrote:
>
>> Hi,
>>
>> Do I have to do more than creating a lifecycle callback method "public
>> void updating()" to do some actions just before updating to the database?
>> It looks like the updating()-method is never called after using the
>> edit-button in the wicket viewer. I can see the object being updated in the
>> logs.
>>
>> Thanks,
>> Erik
>>
Re: updating() lifecycle callback
Posted by Dan Haywood <da...@haywood-associates.co.uk>.
There was a bug raised about this recently, so it may well be broken (ie
never made to work with the JDO objectstore). Should be fixable.
In the meantime, however, an alternative (and probably better) is to use
the new EventBus stuff, @PostsPropertyChangedEvent and the other @PostsXxx
annotations. This will allow you to decouple the changes to some other
service (rather than making it a responsibility of the object being
updated).
Will that work in your case?
Dan
On 10 June 2014 12:15, Erik de Hair <er...@pocos.nl> wrote:
> Hi,
>
> Do I have to do more than creating a lifecycle callback method "public
> void updating()" to do some actions just before updating to the database?
> It looks like the updating()-method is never called after using the
> edit-button in the wicket viewer. I can see the object being updated in the
> logs.
>
> Thanks,
> Erik
>