isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SE Song <seson...@gmail.com>
Subject Re: Customize UI behavior
Date Tue, 28 Nov 2017 11:37:17 GMT
Dear Andi Huber,

Now I make it work, thank you so much

On Tue, Nov 28, 2017 at 4:45 PM, Andi Huber <ahuber@apache.org> wrote:

> In your code
> ...
> simpleObjectRepository.delete(simpleObject);
> ...
> you are passing a 'detached' object (simpleObject) to the persistence
> layer for deleting. It seems, that won't do anything.
>
> A common solution is to delete an object by referencing it with a unique
> key or its id, e.g.  ...
>
> simpleObjectRepository.deleteByKey(simpleObject.getKey());
>
> Another solution might be to re-attach a detached object within the
> current transaction. (I have not tested this with JDO, I only recall
> that JPA can do this.)
>
> Cheers!
>
>
> On 2017-11-28 08:17, SE Song <sesong11@gmail.com> wrote:
> > Dear Andi Huber,
> >
> > Yes, I use ZK VM to store user input temporary, and insert on user click
> > save.
> >
> > I follow your advice, using Isis and ZK on the same web-app. For create
> > and listall are work, except remove (repository.remove) it did nothing.
> >
> > I create a repository here: https://github.com/sesong11/ApacheIsisZK
> >
> > Thank for your help!!!
> >
> > On Mon, Nov 27, 2017 at 8:45 PM, Andi Huber <ahuber@apache.org> wrote:
> >
> > > Thanks!
> > >
> > > Be aware though, that any domain object fetched by your ZKController
> and
> > > bound to your UI via ZK's binding mechanism, lives outside
> transactional
> > > scope. Those objects are detached from the persistence layer! So
> > > changing fields in your detached objects will NOT auto-magically
> reflect
> > > in a commit to your persistence layer.
> > >
> > > You'll have to take care of any updates/changes explicitly and within
> > > Isis-provided transactions!
> > >
> > > Andi
> > >
> > > On 2017-11-27 10:58, SE Song <sesong11@gmail.com> wrote:
> > > > Andi Huber You're the person I'm looking for, You save my life
> finally.
> > > > Thank you so much, I will follow your guide
> > > >
> > >
> > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message